GATE CS 2014 Set 2 — Question 30

Multiple choice 2 marks Question 30 2014

Question 30

MCQ 2 marks · −0.66 Databases

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. What does the following query return?

SELECT empName
FROM   employee E
WHERE  NOT EXISTS (SELECT custId
                   FROM   customer C
                   WHERE  C.salesRepId = E.empId
                     AND  C.rating <> 'GOOD');

Answers and explanations are free — they just need an account.

Where this question comes from

Source: GATE 2014 Computer Science and Information Technology, Set 2 (question number approximate)