Fantastic job! It's time to review what we know about date and time.
- SQL features dates (
'2010-01-01'), time (
'13:00:00') and timestamps (
- You can compare the above types, use
ORDER BY with them.
- The function
EXTRACT(DAY FROM column) allows to extract certain parts of date/time.
AT TIME ZONE to switch between time zones.
INTERVAL '7' DAY is an interval of 7 days which you can add to/subtract from a timestamp/date.
INTERVAL '2-1' YEAR TO MONTH another type of interval, this one is a interval of 2 years and 1 month.
- For current date and time, you can use
Are you ready to practice?