Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1. (35pts] Consider the following relational schema. An employee can work in more than one department; the pct_time field of the Works relation shows
Problem 1. (35pts] 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; managerid is a foreign key references Emp on eid and is the eid of the manager of this 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. Find the managerids of managers who manage only departments with budgets greater than $1 million. 2. Find the enames of employees that work in more than one department. 3. Find the enames of managers who manage the department(s) with the smallest budget(s). 4. Find the employee name for the employee(s) that works in the most departments. 5. Find the department name for the department(s) that have the smallest average age of full time employees (i.e. with pct_time=100). 6. Find the ename for employee(s) that work in all departments
Step 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