0
0
MySQLquery~5 mins

NOW, CURDATE, CURTIME in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ACURRENT_TIME()
BCURDATE()
CNOW()
DCURTIME()
What format does CURDATE() return?
AYYYY-MM-DD
BHH:MM:SS
CYYYY-MM-DD HH:MM:SS
DMM-DD-YYYY
Which function would you use to get only the current time in MySQL?
ANOW()
BCURTIME()
CCURDATE()
DCURRENT_DATE()
What does the query SELECT NOW(); return?
ACurrent year only
BCurrent time only
CCurrent date only
DCurrent date and time
If you want to compare only the date part of a datetime column, which function helps you get the current date?
ACURDATE()
BCURTIME()
CNOW()
DTIME()
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.