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 does the query return?
Consider the query:
What is the output format of this query?
SELECT CURDATE();
What is the output format of this query?
MySQL
SELECT CURDATE();Attempts:
2 left
💡 Hint
CURDATE() returns only the date part, not time.
✗ Incorrect
CURDATE() returns the current date as a string in 'YYYY-MM-DD' format without time.
❓ query_result
intermediate1:30remaining
What is the output of NOW()?
Given the query:
What does this function return?
SELECT NOW();
What does this function return?
MySQL
SELECT NOW();Attempts:
2 left
💡 Hint
NOW() returns both date and time.
✗ Incorrect
NOW() returns the current date and time as a datetime string like '2024-06-15 14:30:00'.
❓ query_result
advanced1:30remaining
What is the output of CURTIME()?
What does the query below return?
SELECT CURTIME();
MySQL
SELECT CURTIME();Attempts:
2 left
💡 Hint
CURTIME() returns only the time part.
✗ Incorrect
CURTIME() returns the current time as a string like '14:30:00'.
🧠 Conceptual
advanced1:30remaining
Difference between NOW() and CURDATE()
Which statement correctly describes the difference between NOW() and CURDATE() in MySQL?
Attempts:
2 left
💡 Hint
Think about what each function returns: date, time, or both.
✗ Incorrect
NOW() returns both date and time, while CURDATE() returns only the date part.
📝 Syntax
expert2:00remaining
Which query will cause an error?
Identify which of the following queries will cause a syntax error in MySQL.
Attempts:
2 left
💡 Hint
Check if NOW() accepts any arguments.
✗ Incorrect
NOW() does not accept any arguments; passing (5) causes a syntax error.