Name: 15 pts
Consider the following relations:
a. Jones. b.
It looks like the result is ordered by the schedule.
5. (20 pts) Consider the following relational schema. An employee can work in more than one department; the pct time field of the Works relation shows the percentage of time that a given employee works in a given department.
Emp(eid: integer, ename: string, age: integer, salary: real)
Works(eid: integer, did: integer, pct_time: integer)
Dept(did: integer, dname: string, budget: real, managerid: integer)
Write the following queries in SQL:
1) Print the names and salary of each employee who works in more than one department.
2) For each department with 20 or more employees, print the department name and the number.
3) Find the managers' name and the department name that the managers manage the departments of employees that work in that department.
4) Find the name and age of managers who manage the departments with the largest budgets, with budgets greater than $2 million, and list the related employees in the department.