Computer Sciences > GATE 2014 SET-3 > SQL
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');
A
Names of all the 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.

Correct : d

Similar Questions

Select operation in SQL is equivalent to
#79 MCQ
Consider the following relations: Consider the following SQL query. SELECT S.Student_Name, sum(P.Marks) FROM Student S, Performance P WHERE S.Roll_No = P...
#1149 NAT
Given the following schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary) departments(dept-id, dept-name, manager-id, location-id) You...
#1225 MCQ

Related Topics

relational algebra query employee relation customer relation foreign key salesRepId GATE computer science 2014 EXISTS SQL GOOD rating customers NOT EXISTS SQL relational database design GATE set 3 question 61

Unique Visitor Count

Total Unique Visitors

Loading......