Data Types
Common data types in MySQL:
Data Types | Usage |
---|---|
INT | integers |
DOUBLE | decimals |
VARCHAR | string (less than 255 chars) |
TEXT | string (more than 255 chars) |
DATETIME | date and time |
DATE | date only |
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:
Last updated