Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dealing with dates
Working with time data
Date and time date
Extracting dates and times
Doing arithmetic with dates
Converting date and time data
Current date and time data
Building date and time data from parts
Summary and review

Instruction

Good job! If you want to select the current time as a TIME data type or the current date as a DATE, you can use casting:

SELECT
  CAST(CURRENT_TIMESTAMP AS TIME) AS Time;

The above query will show the current time.

Exercise

Show the current time as a TIME(0) date type (name the column Time) and the current date as a DATE (name the column Date).

Stuck? Here's a hint!

Use the CURRENT_TIMESTAMP function, and cast it to the appropriate type.