Challenge - 5 Problems
Date and Time Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate1:30remaining
What is the output of CURRENT_DATE?
Consider the SQL query:
What type of value does this query return?
SELECT CURRENT_DATE;
What type of value does this query return?
SQL
SELECT CURRENT_DATE;Attempts:
2 left
💡 Hint
CURRENT_DATE returns only the date part, no time included.
✗ Incorrect
CURRENT_DATE returns the current date without any time information. It is a date type value.
❓ query_result
intermediate1:30remaining
What does CURRENT_TIMESTAMP return?
Look at this SQL query:
What kind of value will this return?
SELECT CURRENT_TIMESTAMP;
What kind of value will this return?
SQL
SELECT CURRENT_TIMESTAMP;Attempts:
2 left
💡 Hint
CURRENT_TIMESTAMP includes both date and time.
✗ Incorrect
CURRENT_TIMESTAMP returns the current date and time as a timestamp value.
🧠 Conceptual
advanced2:00remaining
Difference between CURRENT_DATE and CURRENT_TIMESTAMP
Which statement correctly describes the difference between CURRENT_DATE and CURRENT_TIMESTAMP in SQL?
Attempts:
2 left
💡 Hint
Think about what parts of the date/time each function includes.
✗ Incorrect
CURRENT_DATE returns only the date part without time. CURRENT_TIMESTAMP returns both date and time.
📝 Syntax
advanced2:00remaining
Which SQL query correctly uses CURRENT_TIMESTAMP to insert current date and time?
You want to insert the current date and time into a table named 'events' with a column 'event_time'. Which query is correct?
Attempts:
2 left
💡 Hint
Remember to use parentheses around function calls in VALUES.
✗ Incorrect
Option A correctly uses CURRENT_TIMESTAMP as a function call inside VALUES with parentheses.
🔧 Debug
expert2:30remaining
Why does this query cause an error?
Given the query:
Why does this cause an error?
SELECT CURRENT_DATE + CURRENT_TIMESTAMP;
Why does this cause an error?
SQL
SELECT CURRENT_DATE + CURRENT_TIMESTAMP;Attempts:
2 left
💡 Hint
Think about the data types and what operations are allowed between them.
✗ Incorrect
You cannot add a date and a timestamp directly because they are different data types. This causes a type mismatch error.