MySQL comes with the following data types for storing a date or a date/time value in the database:
DATE
- format YYYY-MM-DDDATETIME
- format: YYYY-MM-DD HH:MI:SSTIMESTAMP
- format: YYYY-MM-DD HH:MI:SSYEAR
- format YYYY or YY
SQL Server comes with the following data types for storing a date or a date/time value in the database:
DATE
- format YYYY-MM-DDDATETIME
- format: YYYY-MM-DD HH:MI:SSSMALLDATETIME
- format: YYYY-MM-DD HH:MI:SSTIMESTAMP
- format: a unique number
Note: The date types are chosen for a column when you create a new table in your database!
Practice Excercise Practice now