Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 48 of 94
Free Preview · 94 of 312 · questions 1–94 of 312 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
Tricky question so I went by elimination. We all agree to eliminate A and D. For B syntax is wrong. It is extracting from a TABLE instead of TIMESTAMP column. Extract() example would be "SELECT EXTRACT(YEAR FROM timestamp '2024-05-15 12:30:00') AS year_val;". That leaves only C. Even though it also doesn't match with the question.
c is the correct one
hy Option (B) Works If the underlying table field is a date or timestamp (rather than a numeric year column), using WHERE year = 2023 filters out all rows that do not literally match year = 2023. By using extract(year FROM sales_data) = 2023, you are correctly filtering rows whose date (or timestamp) in the sales_data column corresponds to the year 2023. Hence, (B) resolves the problem by filtering on the correct year value from the actual date/timestamp column, ensuring all qualifying products are included in the results.