MySQL 20λ²μ§Έμμ
βΆ GROUP BYμ HAVING ββ 1. μ΄μ κ·Έλ£Ήνβ β μμ 11-1) STUDENT ν
μ΄λΈμ μλ νμμ μ
νλ
λλ³ κ·Έλ£Ήμ μΆλ ₯νλΌ. A) mysql> select substring(stu_no, 1, 4) -> from student -> group by substring(stu_no, 1, 4); β β μμ 11-2) κ° μ
νλ
λλ³ μ΄ νμ μλ₯Ό μΆλ ₯νλΌ. A) mysql> select substring(stu_no, 1, 4), count(*) -> from student -> group by substring(stu_no, 1, 4); β β μμ 11-3) λ±λ‘ν νμμ λνμ¬ νλ², λ±λ‘νμ, κ° νμμ΄ λ°μ μ₯νκΈμ μ 체 ν©μ μΆλ ₯νλΌ. A) mysql> select stu_no,..
2021. 2. 9.
MySQL 19λ²μ§Έμμ
βΆ ν΅κ³ν¨μ β 1. λͺ¨λ μ΄μ μ ν(*)β mysql> select * from circle;β β β 2. SELECTμ μ μμ μ§κΈκΉμ§ SELECTμ μ λλΆλΆμ μμ λ μ΄μ μ΄λ¦λ§μ μ§μ νμ§λ§ μμμλ 리ν°λ΄, κ³μ° λλ μ€μΉΌλΌ ν¨μλ₯Ό μ¬μ©ν μλ μλ€. β β μμ 10-1) 2019λ
μ λ±λ‘ν νμμ λν νλ², λ
λ, νκΈ°, μ₯νκΈμ‘, λ©λΆμ΄μ‘(λ±λ‘κΈ-μ₯νκΈ), λ©λΆκΈλΉμ¨(λ©λΆμ΄μ‘/λ±λ‘κΈ*100), '%'μ μΆλ ₯νμμ€. A) mysql> select stu_no, fee_year, fee_term, fee_total, jang_total, -> fee_pay "λ©λΆμ΄μ‘", fee_pay/fee_total*100 "λ©λΆκΈλΉμ¨", '%' -> from fee -> where fee_year = 2..
2021. 2. 8.