Home >Database >Mysql Tutorial >How does MySQL store year values in a table using YEAR data type?
MySQL allows declaring column YEAR type with the help of which we can store year value in the column.
mysql> Create table year1 (Year_Copyright YEAR); Query OK, 0 rows affected (0.21 sec) mysql> Insert into year1(Year_Copyright) values (2017); Query OK, 1 row affected (0.08 sec) mysql> Select * from year1; +----------------+ | Year_Copyright | +----------------+ | 2017 | +----------------+ 1 row in set (0.00 sec)
The above is the detailed content of How does MySQL store year values in a table using YEAR data type?. For more information, please follow other related articles on the PHP Chinese website!