Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions