SMALLINT data type and a default value of 1 : Small Int « Data Type « SQL / MySQL






SMALLINT data type and a default value of 1

     
mysql>
mysql> CREATE TABLE AuthorBios
    -> (
    ->     AuthID SMALLINT UNSIGNED NOT NULL,
    ->     YearBorn YEAR NOT NULL,
    ->     NumBooks SMALLINT NOT NULL DEFAULT 1
    -> );
Query OK, 0 rows affected (0.01 sec)

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

   
    
    
    
    
  








Related examples in the same category

1.Define and use small int
2.SMALLINT(m): 16-bit integer (2 bytes, -32,768 to + 32,767)
3.Use smallint to store year
4.CREATE TABLE statement including two column definitions, SMALLINT data type and INT data type.
5.SmallInt calculation
6.Compare smallint value