List the names and addresses of all employees who are Mangers

10 pts.
Tags:
SQL Database
Employee (emplD, fName, lName, address, DOB, sex, position, deptNo*) Department (deptNo, deptName, mgrEmplD*) Project (projNo, projName, deptNo*) WorksOn (emplD* projNo*, hoursWorked) where Employee contains employee details and emplD is the key. Department contains department details and deptNo is the key. mgrEmplD identifies the employee who is the manger of the department. There is only one manger for each department. Project contains details of the projects in each department and the key is projNo. and WorksOn contains details of the hours worked by employees on each project, and emplD/projNo form the key.

Answer Wiki

Thanks. We'll let you know when a new response is added.

That is actually a fairly straight forward query.

<pre>SELECT *
FROM Employee
WHERE EXISTS (SELECT *
FROM Department
WHERE Department.mgrEmpID = Employee.empID)</pre>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: