Similar questions 2 more →
SQL & Queries

Answer & solution
Official answer: D
Our answer: D assuming nonnull ratings
Step 1: For a fixed employee, the correlated subquery considers only that employee's customers, and finds rows whose rating is unequal to GOOD. NOT EXISTS keeps the employee exactly when this set is empty. Step 2: If ratings are non-NULL, having no customer rated other than GOOD means every customer is GOOD. The premise guarantees at least one customer, so the intended option is D. Step 3: The source does not declare rating NOT NULL. In SQL, NULL <> 'GOOD' is UNKNOWN, not TRUE, so a NULL-rated customer does not enter the subquery. An employee with only NULL-rated customers is still returned even though all-GOOD is not established. The precise query means “no own customer has a known non-GOOD rating”; retain the official D qualification and existing NULL discrepancy.