Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q2: Pts 5] Use the following schema to answer the following question in SQL Employee (eid, name, office) Manager (eid, mid) Each employee has a

image text in transcribed

Q2: Pts 5] Use the following schema to answer the following question in SQL Employee (eid, name, office) Manager (eid, mid) Each employee has a unique key, eid. An employee may have several managers, who are, in turn, employees: both attributes eid and mid in Manager(eid, mid) are foreign keys to Employee. Wrile a uey tantl is that have two or more managers. Your query should Write a query that retrieves all employees that have two or more managers. Your query should return the eid's and the names. 6. An independent employee is an employee without a manager. (For example, the CEO is independent.) Write a query that retrieves all independent employees; you should return their eid and their names. 7. 8. Retrieve the office of all managers of the employee called 'Alice'. If there are multiple employees called Alice, or if one of them has several managers, you have to return all their offices Find all managers for which all the employees they manage share the same office. Your query should return their eid, their name, and the office where all their managed people are located. 9. 10. A manager is an employee who manages at least one other employee. A second-level manager is a manager who manages only managers. Write a query to return all second-level managers; your query should return their eid's and their names

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago