Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The SQL statements comprising the DDL for the COMPANY Database are given to you.

ID: 3912571 • Letter: T

Question

The SQL statements comprising the DDL for the COMPANY Database are given to you. For that database, answer the following queries. Create the files Q1 to Q10 in PostgreSQL. Do follow the restrictions stated for individual queries. When a query asks for "name" of employees, retrieve both, the first and the last names.

5. Retrieve the names of all employees who work on all projects [every project] located in either    Bellaire or Sugarland. That is, if p1, p2, and p3 are located in Bellaire; and p4 and p5 are located in Sugarland; then I want an employee who works on p1, p2, p3, p4, and p5.

https://users.cs.fiu.edu/~navlakha/4710/CreateCompany.sql

Explanation / Answer

If you have any doubts, please give me comment...

SELECT fname, lname

FROM employee

WHERE NOT EXISTS(

SELECT *

FROM project

WHERE plocation ='Bellaire' OR plocation = 'Sugarland' AND NOT EXISTS(

SELECT *

FROM works_on

WHERE essn = ssn AND pno = pnumber

)

);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote