YEAR column type : YEAR : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » YEAR »

 

YEAR column type


mysql>
mysql>
mysql> CREATE TABLE myTable
    -> (
    ->    ID SMALLINT UNSIGNED,
    ->    Copyright YEAR,
    ->    OrderDate TIMESTAMP
    -> );
Query OK, rows affected (0.05 sec)

mysql>
mysql> desc myTable;
+-----------+----------------------+------+-----+-------------------+-------+
| Field     | Type                 | Null | Key | Default           | Extra |
+-----------+----------------------+------+-----+-------------------+-------+
| ID        | smallint(5unsigned | YES  |     | NULL              |       |
| Copyright | year(4)              | YES  |     | NULL              |       |
| OrderDate | timestamp            | NO   |     | CURRENT_TIMESTAMP |       |
+-----------+----------------------+------+-----+-------------------+-------+
rows in set (0.00 sec)

mysql>
mysql> drop table myTable;
Query OK, rows affected (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» YEAR