Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions