Question: 2. Consider the following relational schema: Employee (eid: integer, ename: string, age: integer, salary: real) Department(did: integer, dname: string, budget: real, mgrid: integer) Works(eid: integer,

 2. Consider the following relational schema: Employee (eid: integer, ename: string,

2. Consider the following relational schema: Employee (eid: integer, ename: string, age: integer, salary: real) Department(did: integer, dname: string, budget: real, mgrid: integer) Works(eid: integer, did: integer, pct_time: integer) 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. a) (15 pts.) Write an SQL query to find the IDs of mangers who control the largest amounts. (Hint: Create a table in the WHERE clause to compute the total budget for each manager) ) (as pts.) Write an SQL trigger to express the following constraint: "Whenever an employee is given a raise, the manager's salary must be increased to be at least as much." (increasing a manager's salary to be equal to the employee who received the raise, if the manager's salary is less than the employee's new salary)

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!