Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dates
Time
Timestamps
Extract functions
Timezone conversion
Current date and time
Review
39. Summary

Instruction

Fantastic job! It's time to review what we know about date and time.

  • SQL features dates ('2010-01-01'), times ('13:00:00') and timestamps ('2010-01-01 13:00:00').
  • You can compare the above types, use BETWEEN, and ORDER BY with them.
  • The function EXTRACT(DAY FROM column) extracts certain parts of date/time.
  • Use AT TIME ZONE switches between time zones.
  • INTERVAL '7' DAY is an interval of 7 days which you can add to or subtract from a timestamp/date.
  • INTERVAL '2-1' YEAR TO MONTH is another type of interval, this one is an interval of 2 years and 1 month.
  • For current date and time, you can use CURRENT_DATE, CURRENT_TIME or CURRENT_TIMESTAMP.

Are you ready to practice?

Exercise

Click Next exercise to start our practice.