Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL question Consider the following relational schema. Emp(eid integer, ename: string, age: integer, salary: real) Works (eid: integer, did: integer, pet-time: integer) Dept (did: integer,
SQL question
Consider the following relational schema. Emp(eid integer, ename: string, age: integer, salary: real) Works (eid: integer, did: integer, pet-time: integer) Dept (did: integer, dname: string, budget: real, managerid: integer) Note that a manager is an employee as well and their manager id and employee id are the same. An employee can work in more than one department. The pet time field of the Works relation shows the percentage of time that a given employee works in a given department. Formulate the following queries in SQL: Print the name of each employee whose salary exceeds the budget of all of the departments that he or she works in Find the managerids of managers who manage only departments with budgets greater than $1 million Find the enames of managers who manage the departments with the largest budget Find the managerids of managers who control the largest amount of total budget. As an example, if a manager manages two departments, the amount of total budget for him will be the sum of budgets of two departments. We want to find managers that have max total budgetStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started