Consider the following structure Customer (custid,custnmae,address,city,country) Choose the option display all customer who all are not from Hyderabad and delhi.
Answer options
A
Select * from customer where city in(“Hyderabad”,”Delhi”);
B
Select * from customer where city not in(“Hyderabad”,”Delhi”);
C
Select * from customer where city <>“Hyderabad” and city <>”Delhi”;
Correct answer: Select * from customer where city not in(“Hyderabad”,”Delhi”);, Select * from customer where city <>“Hyderabad” and city <>”Delhi”;
Explanation
Both options are logically correct for excluding Hyderabad and Delhi. 'NOT IN ("Hyderabad","Delhi")' (index 1) and 'city <> "Hyderabad" AND city <> "Delhi"' (index 2) are equivalent and both return customers not from either city.