Question: Assignment Questions (Submission required, 50 points) Problem 1 (50 points) You are given the following database schema. An employee can work in multiple departments. The

 Assignment Questions (Submission required, 50 points) Problem 1 (50 points) You

Assignment Questions (Submission required, 50 points) Problem 1 (50 points) You are given the following database schema. An employee can work in multiple departments. The percent attribute in WorksIn specifies how much time the employee works in that department. Assume that managerID is a foreign key from another table. Be careful with ambiguity of the name attribute. Employee(employeeID: integer, name: string, age: integer, salary: real) WorksIn(employeeID: integer, departmentID:integer, percent: integer) Department(departmentID: integer, name: string, budget: real, managerID, integer) Write SQL queries for the following (10 points each): 1. Return the managerID for all departments where the budget is at least $2,000,000. 2. Return the names of all employees who work in at least two departments. 3. Return the names of managers who manage the department(s) with the smallest budget(s). Note that the managerID is a manager's employeeID. 4. Find the managerID of all managers who manager more than $20,000,000. Note that a manager who manages multiple departments manages the sum of the budgets from those departments. 5. Print the min, max, and average age of the employees in each department. Your results should be grouped by department

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!