A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. 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.
Answer:Names of all the employees with all their customers having a ‘GOOD’ rating.
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: