Question: 2. SIngle table queries (with aggregation) - Tables names are in the order that they appear DEPARTMENT EMPLOYEE PROJECT WORKS a. How many employees started
2. SIngle table queries (with aggregation) - Tables names are in the order that they appear
DEPARTMENT
EMPLOYEE
PROJECT
WORKS




a. How many employees started before 1990?
b. Report the number of employees in each department
c. Report the departments that have an average salary
d. How many employees have a salary above the average salary?
e. How many employees have a salary of at least $40,000 and began their employment after 1st Jan 1995?
f. How many employees have a salary greater than $60,000 and are not in Department 4?
g. How many employees are either in Department 1, or earn more than $50,000.
h. Report the total salary of each department.
COLUMN_NAMEDATA TYPE 1 DEPARTNO 2 DEPTNAME VARCHAR2 (20 BYTE) Yes 3 DEPTLOCATION VARCHAR2 (50 BYTE) Yes 4 NUMBERSTAFF NUMBER (20,0) NULLABLE DATA DEFAULTCOLUMN IDCOMMENTS (urill) (null) (null) (null) 1 (null) 2 (null) 3 (null) 4 (null) NUMBER (10,0) No Yes NULLABLE DATA DEFAULTCOLUMN ID COMMENTS 1 (null) 2 (null) 3 (null) 4 (null) 5 (null) 6 (null) 7 (null) COLUMN NAME DATA TYPE 1 EMPLOYNO 2 EMPLOYLASTNAME VARCHAR2 (25 BYTE) Yes 3 EMPLOYFIRSTNAME VARCHAR2 (20 BYTE) Yes 4 EMPLOYSALARY NUMBER (38,2) 5 STARTDATE 6 BENEFITSNO 7 DEPARTNO NUMBER (10,0) No Tes Tes Tes Tes (null) (null) (null) (null) (null) (null) (null) DATE NUMBER (10,0) NUMBER (10,0) COLUMN NAME DATA TYPE NULLABLE DATA DEFAULTCOLUMN IDCOMMENTS 1 PROJECTNO NUMBER (10,o) 1 (null) 2 (null) 3 (null) 4 (null) No (null) (null) (null) (null) 2 PROJECTNAME VARCHAR2 (25 BYTE) Yes PROUECTTYPE VARCHAR2 (25 BYTE) Yes 4 BUDGET NUMBER (38,2) es COLUMIN NAME DATA_TYPE NULLABLE DATA DEFAULTCOLUMIN IDCOMMENTS 1 EMPLOYNO 2 PROJECTNO 3 ROLE NUMBER (10,0) NUMBER (10,0) VARCHAR2 (25 BYTE) Yes NULLABLE DATA DEFAULTCOLUMN IDCOMMENTS No No (null) (null) (null) 1 (null) 2 (null) 3 (null)
Step by Step Solution
There are 3 Steps involved in it
SQL Queries Based on EMPLOYEE and DEPARTMENT Tables Single Table Aggregation a How many employees st... View full answer
Get step-by-step solutions from verified subject matter experts
