Consider the following relational schema: employee(empId,empName,empDept)…
Consider the following relational schema:
employee(empId,empName,empDept)
customer(custId,custName,salesRepId,rating)
salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer.
SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId AND C.rating <> ’GOOD’);
What does the following query return?
- A.
Names of all employees with at least one of their customers having a ‘GOOD’ rating.
- B.
Names of all the employees with at most one of their customers having a ‘GOOD’ rating.
- C.
Names of all the employees with none of their customers having a ‘GOOD’ rating.
- D.
Names of all the employees with all their customers having a ‘GOOD’ rating.
Attempted by 56 students.
Sign up free to check your answer
Sign up freeLoading lesson…

