Complete the code to format the current date as 'YYYY-MM-DD'.
SELECT TO_CHAR(CURRENT_DATE, [1]);The format string 'YYYY-MM-DD' outputs the date in year-month-day format, which is the standard ISO format.
Complete the code to format the current timestamp as 'HH24:MI:SS'.
SELECT TO_CHAR(CURRENT_TIMESTAMP, [1]);'HH24:MI:SS' formats the time in 24-hour format with minutes and seconds. 'MI' is minutes, not 'MM'.
Fix the error in the code to format the date as 'Month DD, YYYY'.
SELECT TO_CHAR(CURRENT_DATE, [1]);'Month' capitalizes the first letter and spells out the full month name. Lowercase 'month' returns all lowercase, uppercase 'MONTH' returns all uppercase.
Fill both blanks to format the timestamp as 'YYYY-MM-DD HH24:MI:SS'.
SELECT TO_CHAR(NOW(), [1] || ' ' || [2]);
We combine the date format 'YYYY-MM-DD' and the time format 'HH24:MI:SS' separated by a space to get the full timestamp format.
Fill all three blanks to format the date as 'Day, DD Month'.
SELECT TO_CHAR(CURRENT_DATE, [1] || ', ' || [2] || ' ' || [3]);
'Day' gives the full day name padded to 9 characters, 'DD' is day number, and 'Month' is full month name with first letter capitalized.