This document lists and describes 20 different aggregate functions that can be used to analyze and summarize data from multiple rows in a database table. Some examples of functions listed include MAX(), MIN(), SUM(), AVG(), and COUNT() to find the maximum value, minimum value, total sum, average, and count of rows that meet certain criteria. The document also provides 20 examples of how these aggregate functions could be used with columns in an employee table to calculate values like total salary by department, average salary by job type, and number of employees meeting certain conditions.
Download as TXT, PDF, TXT or read online on Scribd
100%(1)100% found this document useful (1 vote)
561 views
4 Multi Row Functions
This document lists and describes 20 different aggregate functions that can be used to analyze and summarize data from multiple rows in a database table. Some examples of functions listed include MAX(), MIN(), SUM(), AVG(), and COUNT() to find the maximum value, minimum value, total sum, average, and count of rows that meet certain criteria. The document also provides 20 examples of how these aggregate functions could be used with columns in an employee table to calculate values like total salary by department, average salary by job type, and number of employees meeting certain conditions.
1.WAQTD NUMBER OF EMPLOYEES GETTING SALARY LESS THAN 2000 IN DEPTNO 10
2.WAQTD TOTAL SALARY NEEDED TO PAY EMPLOYEES WORKING AS CLERK 3.WAQTD AVERAGE SALARY NEEDED TO PAY ALL EMPLOYEES 4.WAQTD NUMBER OF EMPLOYEES HAVING 'A' AS THEIR FIRST CHARACTER 5.WAQTD NUMBER OF EMPLOYEES WORKING AS CLERK OR MANAGER 6.WAQTD TOTAL SALARY NEEDED TO PAY EMPLOYEES HIRED IN FEB 7.WAQTD NUMBER OF EMPLOYEES REPORTING TO 7839 (MGR) 8.WAQTD NUMBER OF EMPLOYEES GETTING COMISSION IN DEPTNO 30 9.WAQTD AVG SAL , TOTAL SAL , NUMBER OF EMPS AND MAXIMUM SALARY GIVEN TO EMPLOYEES WORKING AS PERSIDENT 10.WAQTD NUMBER OF EMPLOYEES HAVING 'A' IN THEIR NAMES 11.WAQTD NUMBER OF EMPS AND TOTAL SALary needed to pay THE EMPLOYEES WHO HAVE 2 CONSICUTIVE L's IN THEIR NAMES 12.WAQTD NUMBER OF DEPARTMENTS PRESENT IN EMPLOYEE TABLE 13.WAQTD NUMBER OF EMPLOYEES HAVING CHARACTER '_' IN THEIR NAMES 14.WAQTD NUMBER OF EMPLOYEES HAVING ATLEAST 2 PERCENTILES IN THEIR NAMES 15.WAQTD TOTAL SALARY GIVEN TO EMPLOYEES WORKING AS CLERK IN DEPT 30 16.WAQTD MAXIMUM SALARY GIVEN TO THE EMPLOYEES WORKING AS ANALYST 17.WAQTD NUMBER OF DISTINCT SALARIES PRESENT IN EMPLOYEE TABLE 18.WAQTD NUMBER OF JOBS PRESENT IN EMPLOYEE TABLE 19.WATQD AVG SALARY GIVEN TO THE CLERK 20.WAQTD MINIMUM SALARY GIVEN TO THE EMPLOYEES WHO WORK IN DEPT 10 AS MANAGER OR A CLERK