Question 1
Which query returns the date **01-OCT-2020** (the first day of the fourth quarter of 2020)?
A. SELECT TRUNC(DATE '2020-11-23', 'MONTH') FROM DUAL
The 'MONTH' model truncates to the first day of the current month, giving 01-NOV-2020, not the start of the quarter.
B. SELECT TRUNC(DATE '2020-11-23', 'Q') FROM DUALCorrect answer
TRUNC with the 'Q' format model truncates to the first day of the quarter. November falls in Q4 (Oct-Dec), so the result is 01-OCT-2020.
C. SELECT TRUNC(DATE '2020-11-23', 'YEAR') FROM DUAL
The 'YEAR' model truncates to the first day of the year, giving 01-JAN-2020, one quarter boundary too far back.
D. SELECT ROUND(DATE '2020-11-23', 'Q') FROM DUAL
ROUND('Q') rounds up on the 16th day of the quarter's second month (16-Nov). The 23rd is past that threshold, so it rounds up to the next quarter start, 01-JAN-2021.
Explanation
The date format model passed to TRUNC and ROUND controls the granularity: 'Q' operates on quarter boundaries, 'MONTH' on month boundaries, and 'YEAR' on year boundaries. TRUNC always moves down to the first day of that unit, whereas ROUND moves to the nearest boundary, and for 'Q' it rounds up starting from the 16th day of the quarter's middle month. Choosing the wrong model or confusing TRUNC with ROUND lands on a different date.