Home / Expert Answers / Computer Science / you-are-given-the-following-database-schema-an-employee-can-work-in-multiple-departments-the-per-pa754

(Solved): You are given the following database schema. An employee can work in multiple departments. The per ...



You are given the following database schema. An employee can work in multiple departments. The percent attribute in WorksIn s

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. 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 . 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.


We have an Answer from Expert

View Expert Answer

Expert Answer


1)Return the managerID for all departments where the budget is at least $2,000,000:SELECT managerIDFROM DepartmentWHERE budget >= 2000000;
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe