Group By, Having, Sub-Query Problems
Group By, Having, Sub-Query Problems
TASKS
GROUP BY,
HAVING,
SUB-QUERY
PROBLEMS
1 – Students with the GPA average for all semesters
2 – Classes with the GPA average for all semesters
3 – Classes with the GPA average for each semester
4 – Average of 8th class’s GPA for all semesters
5 – Average of 8th class’s GPA for each semester
6 – Students with average GPA=3 ?
7 – Classes with GPA Average for Amount of student >=3
8 – Semesters with GPA Average for all classes.
9 – Grand average with rollup
10 – Categorize people into child,teenager and adult depending on their ages
11 – Compare a parameter and value with DECODE
SELECT
ENAME,
DECODE( SIGN(SAL-2000 ),1,'GREATER THAN 2000', 'SMALLER THAN 2000') SALARY
FROM EMP;
12 – List the number of old and new cars.
1999 2000
1999 2000