Determine the validity of the following three statements. Circleeither True or False.1.Group functions work across many rows to produce one result per group.True/False2.Group functions include nulls in calculations.
True/False
3.The WHEREclause restricts rows before inclusion in a group calculation.
True/False
The HR department needs the following reports:
4.Find the highest, lowest, sum, and average salary of all employees. Label the columns
Maximum, Minimum, Sum, and Average, respectively. Round your results to the
nearest whole number. Place your SQL statement in a text file named lab_04_04.sql.
5.Modify the query in lab_04_04.sqlto display the minimum, maximum, sum, and average salary for each job type. Resave lab_04_04.sqlas lab_04_05.sql. Run the statement in lab_04_05.sql.
Oracle Database 10g: SQL Fundamentals I 4 -26
Practice 4 (continued)
6.Write a query to display the number of people with the same job.
Generalize the query so that the user in the HR department is prompted for a job title. Save the script to a file named lab_04_06.sql.
7.Determine the number of managers without listing them. Label thecolumn Number of Managers. Hint: Use the MANAGER_IDcolumn to determine the number of managers.
8.Find the difference between the highest and lowest salaries. Label the column DIFFERENCE.
If you have time, complete the following exercises:
9.Create a report to display the manager number and the salary of the lowest-paid employee for that manager. Exclude anyone whose manager is not known. Exclude any groups where the minimum salary is $6,000 or less. Sort the output in descending order of salary.
Oracle Database 10g: SQL Fundamentals I 4 -27
Practice 4 (continued)
If you want an extra challenge, complete the following exercises:
10.Create a query to display the total number of employees and, of that total, the number of employees hired in 1995, 1996, 1997, and 1998. Create appropriate column headings.
11.Create a matrix query to display the job, the salary for that job based on department number, and the total salary for that job, for departments 20, 50, 80, and 90, giving each column an appropriate heading.
Oracle Database 10g: SQL Fundamentals I 4 -28
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- howto234.com 版权所有 湘ICP备2022005869号-3
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务