Question: Answer the following query in SQL. a. For each department whose average employee salary is more than $30,000, retrieve the department name and the number

Answer the following query in SQL.
a. For each department whose average employee salary is more than $30,000, retrieve the department name and the number of employees working for that department. b. Suppose that we want the number of male employees in each department making more than $30,000, rather than all employees. Answer this query in SQL. c. A view that has the project name, controlling department name, number of employees, and total hours worked per week on the project for each project with more than one employee working on it.
EMPLOYEE \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|} \hline Fname & Minit & Lname & Ssn & Bdate & Address & Sex & Salary & Super_ssn & Dno \\ \hline \end{tabular} DEPARTMENT \begin{tabular}{|l|l|l|l|} \hline Dname & Dnumber & Mgr_ssn & Mgr_start_date \\ \hline \end{tabular} DEPT_LOCATIONS \begin{tabular}{|l|l|} \hline Dnumber & Dlocation \\ \hline \end{tabular} PROJECT \begin{tabular}{|l|l|l|l|} \hline Pname & Pnumber & Plocation & Dnum \\ \hline \end{tabular} WORKS_ON \begin{tabular}{|l|l|l|} \hline Essn & Pno & Hours \\ \hline \end{tabular} DEPENDENT \begin{tabular}{|l|l|l|l|l|} \hline Essn & Dependent_name & Sex & Bdate & Relationship \\ \hline \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
