Recall & Review
beginner
What does the MySQL function
NOW() return?NOW() returns the current date and time in the format YYYY-MM-DD HH:MM:SS.
Click to reveal answer
beginner
How is
CURDATE() different from NOW() in MySQL?CURDATE() returns only the current date (YYYY-MM-DD), while NOW() returns both date and time.
Click to reveal answer
beginner
What does the MySQL function
CURTIME() return?CURTIME() returns the current time in the format HH:MM:SS without the date.
Click to reveal answer
beginner
Write a MySQL query to get the current date and time using
NOW().SELECT NOW();
This query returns the current date and time.
Click to reveal answer
beginner
If you want to store only the current time in a column, which function would you use?
You would use CURTIME() to get the current time only.
Click to reveal answer
Which MySQL function returns the current date and time together?
✗ Incorrect
NOW() returns both current date and time. CURDATE() returns only date, and CURTIME() returns only time.
What format does
CURDATE() return?✗ Incorrect
CURDATE() returns the date in YYYY-MM-DD format.
Which function would you use to get only the current time in MySQL?
✗ Incorrect
CURTIME() returns only the current time.
What does the query
SELECT NOW(); return?✗ Incorrect
NOW() returns the current date and time.
If you want to compare only the date part of a datetime column, which function helps you get the current date?
✗ Incorrect
CURDATE() returns the current date, useful for date-only comparisons.
Explain the difference between NOW(), CURDATE(), and CURTIME() in MySQL.
Think about what part of the date/time each function returns.
You got /3 concepts.
Write a simple MySQL query to get the current time and explain what it returns.
Focus on the function that returns time only.
You got /3 concepts.