For the following table:
ID Name Category Price Quantity Supplier Date 301 Iphone Electronics 80000 25 Apple Inc. 2022-06-10 302 Samsung Electronics 60000 40 Samsung Elec. 2022-05-15 303 Nike Footwear 12000 50 Nike 2022-07-01 304 Dell Electronics 90000 10 Dell 2022-03-20 305 Puma Footwear 8000 60 Puma 2022-04-05
What will be the sequence of steps from the following to retrieve the products after May 2022?
(A) Use the WHERE clause to filter rows with Date>'2022-05-31'
(B) Select columns Name, Category and Date
(C) Write the SELECT query
(D) Execute the query
For the following table:
| ID | Name | Category | Price | Quantity | Supplier | Date |
|---|---|---|---|---|---|---|
| 301 | Iphone | Electronics | 80000 | 25 | Apple Inc. | 2022-06-10 |
| 302 | Samsung | Electronics | 60000 | 40 | Samsung Elec. | 2022-05-15 |
| 303 | Nike | Footwear | 12000 | 50 | Nike | 2022-07-01 |
| 304 | Dell | Electronics | 90000 | 10 | Dell | 2022-03-20 |
| 305 | Puma | Footwear | 8000 | 60 | Puma | 2022-04-05 |
What will be the sequence of steps from the following to retrieve the products after May 2022?
(A) Use the WHERE clause to filter rows with Date>'2022-05-31'
(B) Select columns Name, Category and Date
(C) Write the SELECT query
(D) Execute the query
Solution
The query is built in the order it is written: start the SELECT statement (C), choose the columns Name, Category and Date (B), add the WHERE clause with Date > '2022-05-31' (A), then execute it (D).
Only Nike (2022-07-01) satisfies this condition.
Options 1, 2 and 3: choosing columns or adding a filter before writing the SELECT query is illogical, since the columns and WHERE clause are parts of the SELECT query. Option 3 also executes before the query is written.
Related questions:
2026: 13 May Shift 2
2025: 20 May Shift 1
2025: 20 May Shift 1
2025: 13 May Shift 2
2025: 27 May Shift 2