Skip to content

Commit b2fe2f0

Browse files
committed
Group by
1 parent a15e711 commit b2fe2f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

11. GROUPBY.sql

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- SYNTAX :-
2+
-- select ATT, AGGREGATE FUN from TABLENAME group by ATT;
3+
4+
5+
-- by default it will just fetch DISTINCT type data.
6+
Select Department from Employee group by Department;
7+
8+
-- COUNT ( department, and their count);
9+
select Department, COUNT(Department) from Employee group by Department;
10+
11+
-- AVG ( department, and their average salary);
12+
select Department, AVG(Salary) from Employee group by Department;
13+
14+
-- MIN ( department, and their minimum salary);
15+
select Department, MIN(Salary) from Employee group by Department;
16+

0 commit comments

Comments
 (0)