Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Boolean
Date and time
37. Time
Summary

Instruction

Very good! The next data type we're going to learn is time. The format for this type is hh:mm:ss, where hh stands for hour, mm for minutes and ss for seconds. It's used to store time (e.g. in timetables). This type of column again requires apostrophes.

Please note that this data type is absent from many databases.

Exercise

When Peter found out about the new data type, he immediately added another column called precise_time to his table. Now, the payment table has the following columns:

  • user_id of type integer,
  • amount of type decimal(6,2),
  • day of type date,
  • precise_time of type time.

It's time for you to play around! Insert new rows into the table, select some rows with a specific time etc.