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

Instruction

Finally, we're going to learn a mixture of the date and time data types – datetime, which is also called timestamp. Its format is YYYY-MM-DD hh:mm:ss. As you can see, it includes both the date and the time.

This type goes by various names in various databases: timestamp, datetime, smalldatetime. In our database, all of these names work.

Exercise

Peter wants to create yet another version of his table payment, this time with the following columns: user_id (integer), amount (decimal(4,2)) and date_time (timestamp).

Create the new table.