Last 4 basic SQL problems rounding, average, etc
576484May 8 2007 — edited May 8 2007First question as follows:
[b]I need to display 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.
Maximum Minimum Sum Average
------------ ------------ -------- ----------
5000 800 29025 2073
#1 continuted: after I do that I must
display the minimum, maximum, sum, and average salary for each job type. . Rerun your query.
JOB Maximum Minimum Sum Average
----------------- ------------ ------------ ------ ----------
ANALYST 3000 3000 6000 3000
CLERK 1300 800 4150 1038
MANAGER 2975 2450 8275 2758
PRESIDENT 5000 5000 5000 5000
SALESMAN 1600 1250 5600 1400
Question #2
Again I need to make a query to display the department name, location name, number of employees, and the average salary for all employees in that department. I need to label the columns dname, loc, Number of People, and Salary, respectively. Round the average salary to two decimal places.
DNAME LOC Number of People Salary
-------------------- ---------------- --------------------- ----------
ACCOUNTING NEW YORK 3 2916.67
RESEARCH DALLAS 5 2175
SALES CHICAGO 6 1566.67
Question #3
I need to make a query that will display the total number of employees and of that total the number who were hired in 1980, 198l, l982, and 1983. Give appropriate column headings.
TOTAL 1980 1981 1982 1983
----------- ------- -------- -------- ---------
14 1 10 2 1
Last Question: