0
0
SQLquery~5 mins

CURRENT_DATE and CURRENT_TIMESTAMP in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does CURRENT_DATE return in SQL?
CURRENT_DATE returns the current date from the system in the format YYYY-MM-DD, without the time part.
Click to reveal answer
beginner
What is the difference between CURRENT_DATE and CURRENT_TIMESTAMP?
CURRENT_DATE returns only the date (year, month, day). <br>CURRENT_TIMESTAMP returns both the date and the current time (hours, minutes, seconds, and fractional seconds).
Click to reveal answer
beginner
How can you use CURRENT_TIMESTAMP in a SQL query?
You can use CURRENT_TIMESTAMP to get the exact date and time when a query runs. <br>Example: SELECT CURRENT_TIMESTAMP;
Click to reveal answer
intermediate
Is CURRENT_DATE affected by time zones in SQL?
Yes, CURRENT_DATE returns the date based on the database server's time zone settings.
Click to reveal answer
intermediate
Can CURRENT_TIMESTAMP be used to track when a record was inserted?
Yes, CURRENT_TIMESTAMP is often used in INSERT or UPDATE statements to record the exact date and time of the change.
Click to reveal answer
What does CURRENT_DATE return in SQL?
AThe date of the last update
BThe current time only
CThe current date and time
DThe current date without time
Which SQL function returns both date and time?
ACURRENT_DATE
BCURRENT_TIMESTAMP
CCURRENT_TIME
DNOW()
If you want to store the exact time a record was created, which should you use?
ACURRENT_DATE
BDATE()
CCURRENT_TIMESTAMP
DTIME()
Does CURRENT_DATE include the time of day?
ANo, only date
BYes, always
COnly if specified
DDepends on the database
Which of these is true about CURRENT_TIMESTAMP?
AIt returns date and time
BIt returns only the date
CIt returns only the time
DIt returns the server uptime
Explain what CURRENT_DATE and CURRENT_TIMESTAMP return in SQL and when you might use each.
Think about whether you need just the day or the full date and time.
You got /4 concepts.
    Describe how time zones might affect the values returned by CURRENT_DATE and CURRENT_TIMESTAMP.
    Consider where the database server is located and its clock settings.
    You got /3 concepts.