Data Types
Last updated
Last updated
Common data types in MySQL:
Data Types | Usage |
---|---|
In MySQL, DATETIME
and DATE
must be quoted using single quotes or double quotes. The format must be YYYY-MM-DD
and HH:MM:SS
. For example, we create a new table t_datetime
:
Insert a date:
INT
integers
DOUBLE
decimals
VARCHAR
string (less than 255 chars)
TEXT
string (more than 255 chars)
DATETIME
date and time
DATE
date only