The task is to display all the details of customers of Delhi (contained in table CUSTOMER) who made a purchase of more than 10,000. Which of the following query will be used for the above operation on table CUSTOMER?
The task is to display all the details of customers of Delhi (contained in table CUSTOMER) who made a purchase of more than 10,000. Which of the following query will be used for the above operation on table CUSTOMER?
Solution
"All the details" means every column, so the query must use SELECT *. Both conditions must hold together, so they are joined with AND: purchase > 10000 for more than 10,000 and city = 'Delhi' for Delhi customers. Option 1 is the only query that does both.
In real SQL, write the number without a comma (10000), since the comma would cause a syntax error.
Options 2 and 4: they use < and <=, which select purchases of 10,000 or less, not more.
Option 3: it selects only the purchase column, not all details, and | is not a valid logical operator in this query.
Related questions:
2025: 30 May Shift 2
2026: 29 May Shift 1
2026: 18 May Shift 2