Show the SQL query commands (MySQL or SQLite) that can be used to generate the f
ID: 3841340 • Letter: S
Question
Show the SQL query commands (MySQL or SQLite) that can be used to generate the following data that goes into a Status Report for upper management: a. All managers who currently have no direct reports; are not managing any employees) b. The total worth of all the contracts the company currently has. c. The total salaries of all employees in each department d. The minimum and maximum salary for each department. e. Listing of all employees who reside in the same city, grouped by city f. Employees who make at least $73000. g. The average salary of the employees, for the whole company; and by dept. h. Employees who do not have a company (av.com) email address as their contact information.Explanation / Answer
a. Select ManagerId from ManagementInfo where EmployeeId IS NULL;
b . Select sum(NetWorth) from Contractinfo ;
c. Select Sum(Salary) from EmployeeRemuneration inner join EmployeeLocation on EmployeeRemuneration.EmployeeId = EmployeeLocation.EmployeeId group by EmployeeLocation.DeptId;
d. Select Min(Salary) ,Max(Salary) from EmployeeRemuneration inner join EmployeeLocation on EmployeeRemuneration.EmployeeId = EmployeeLocation.EmployeeId group by EmployeeLocation.DeptId;
e. Select * from EmployeeContactInfo-1 group by City;
f. Select * from EmployeeRemuneration where Salary >= 73000;
g. Select Avg(Salary) from EmployeeRemuneration inner join EmployeeLocation on EmployeeRemuneration.EmployeeId = EmployeeLocation.EmployeeId group by EmployeeLocation.DeptId;
Select Avg(Salary) from EmployeeRemuneration inner join EmployeeLocation on EmployeeRemuneration.EmployeeId = EmployeeLocation.EmployeeId;
h. Select * from EmployeeContactInfo-2 where email NOT LIKE '%@av.com';
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.