μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Python challenge
- ubuntu
- μ°λΆν¬
- μλ° κΈ°μ΄
- Python
- λ°μ΄ν°λ² μ΄μ€
- λ¬μ€νΈ νλ‘κ·Έλλ° κ³΅μ κ°μ΄λ
- Database
- Rust
- μκ³ λ¦¬μ¦
- νμ΄μ¬ μ²Όλ¦°μ§
- μλ° κ°λ
- Operating System
- λ°μ΄ν° ν΅μ
- νμ΄μ¬ μκ³ λ¦¬μ¦
- νμ΄μ¬ μ±λ¦°μ§
- μλ°
- OS
- νμ΄μ¬
- λ¬μ€νΈ μμ
- λ¬μ€νΈ
- Reversing
- μ΄μ체μ
- λ°±μ€ λ¬μ€νΈ
- java
- data communication
- μ€λΌν΄DB
- μ€λΌν΄
- C
- λ°±μ€
Archives
- Today
- Total
IT’s Portfolio
[Lecture] DataBase - Day 5 λ³Έλ¬Έ
728x90
λ°μν
π₯ DataBase - Day 5
ππ» [Chapter 07] λ€μ€ν ν¨μμ λ°μ΄ν° κ·Έλ£Ήν
[01] λ€μ€ν ν¨μ
- sum
- λ°μ΄ν°μ ν©μ ꡬνλ ν¨μ
- count
- λ°μ΄ν° κ°μλ₯Ό μΆλ ₯νλ ν¨μ
- max
- μ λ ₯ λ°μ΄ν° μ€ μ΅λκ° λ°ν
- min
- μ λ ₯ λ°μ΄ν° μ€ μ΅μκ° λ°ν
- avg
- μ λ ₯ λ°μ΄ν°μ νκ· κ°μ ꡬνλ ν¨μ
[02] group by μ
select [μ‘°νν μ΄n μ΄λ¦]
from [μ‘°νν ν
μ΄λΈ μ΄λ¦]
where [μ‘°νν νμ μ λ³νλ 쑰건μ]
group by [κ·Έλ£Ήνν μ΄μ μ§μ (μ¬λ¬ κ° μ§μ κ°λ₯)]
order by [μ λ ¬νλ €λ μ΄ μ§μ ]
- μ¬λ¬ λ°μ΄ν°μμ μλ―Έ μλ νλμ κ²°κ³Όλ₯Ό νΉμ μ΄ κ°λ³λ‘ λ¬Άμ΄μ μΆλ ₯ν λ μ¬μ©
- μ μμ
- λ€μ€ν ν¨μλ₯Ό μ¬μ©νμ§ μμ μΌλ° μ΄μ group by μ μ λͺ μνμ§ μμΌλ©΄ select μ μμ μ¬μ©ν μ μμ
[03] having μ
select [μ‘°νν μ΄n μ΄λ¦]
from [μ‘°νν ν
μ΄λΈ μ΄λ¦]
where [μ‘°νν νμ μ λ³νλ 쑰건μ]
group by [κ·Έλ£Ήνν μ΄ μ§μ (μ¬λ¬ κ° μ§μ κ°λ₯)]
having [μΆλ ₯ κ·Έλ£Ήμ μ ννλ 쑰건μ]
order by [μ λ ¬νλ €λ μ΄ μ§μ ]
- select λ¬Έμ group by μ μ΄ μ‘΄μ¬ν λλ§ μ¬μ© κ°λ₯
- group by μ μ ν΅ν΄ κ·Έλ£Ήνλ κ²°κ³Ό κ°μ λ²μλ₯Ό μ ννλ λ° μ¬μ©
- μ μμ
- where μ μ μΆλ ₯ λμ νμ μ ννκ³ , having μ μ κ·Έλ£Ήνλ λμμ μΆλ ₯μμ μ νν¨
[04] κ·Έλ£Ήνμ κ΄λ ¨λ μ¬λ¬ ν¨μ
select [μ‘°νν μ΄n μ΄λ¦]
from [μ‘°νν ν
μ΄λΈ μ΄λ¦]
where [μ‘°νν νμ μ λ³νλ 쑰건μ]
group by rollup [κ·Έλ£Ήν μ΄ μ§μ (μ¬λ¬ κ° μ§μ κ°λ₯)]
select ...
from ...
where ...
group by cube ...
- rollup, cube
- κ·Έλ£Ήν λ°μ΄ν°μ ν©κ³λ₯Ό ν¨κ» μΆλ ₯νλ λ° μ¬μ©
select ...
from ...
where ...
group by grouping sets ...
- grouping sets
- μ¬λ¬ κ·Έλ£Ήν λμ μ΄μ κ²°κ³Ό κ°μ κ°κ° κ°μ μμ€μΌλ‘ μΆλ ₯
select ...
grouping [group by μ μ rollup λλ cubeμ λͺ
μν κ·Έλ£Ήν ν μ΄ μ΄λ¦]
from ...
where ...
group by rollup or cube ...
- grouping
- νμ¬ κ²°κ³Όκ° κ·Έλ£Ήν λμ μ΄μ ꡬ룹νκ° μ΄λ£¨μ΄μ§ μνμ μ§κ³μΈμ§ μ¬λΆλ₯Ό μΆλ ₯
select ...
grouping_id [κ·Έλ£Ήν μ¬λΆλ₯Ό νμΈν μ΄(μ¬λ¬ κ° μ§μ κ°λ₯)]
from ...
group by rollup or cube ...
- grouping_id
- grouping ν¨μμ²λΌ νΉμ μ΄μ κ·Έλ£Ήν μ¬λΆλ₯Ό μΆλ ₯ν μ μμΌλ©°, κ²μ¬ν μ΄μ μ¬λ¬ κ° μ§μ ν μ μμ
select ...
listagg([λμ΄ν μ΄(νμ)], [κ° λ°μ΄ν°λ₯Ό ꡬλΆνλ ꡬλΆμ(μ ν)])
within group(order by λμ΄ν μ΄μ μ λ ¬ κΈ°μ€ μ΄(μ ν))
from ...
where ...
- listagg ~ within group
- κ·Έλ£Ήν λ°μ΄ν°λ₯Ό νλμ μ΄μ κ°λ‘λ‘ λμ΄νμ¬ μΆλ ₯νλ λ° μ¬μ©
- pivot/unpivot
- ν/μ΄ λ°κΎΈμ΄ μΆλ ₯
728x90
λ°μν
'Development Study' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[Lecture] DataBase - Day 9 (1) | 2023.12.29 |
---|---|
[Lecture] DataBase - Day 6~8 (1) | 2023.12.29 |
[Lecture] DataBase - Day 4 (0) | 2023.12.29 |
[Lecture] DataBase - Day 3 (1) | 2023.12.29 |
[Lecture] DataBase - Day 2 (0) | 2023.12.29 |
Comments