SMALLINT(m): 16-bit integer (2 bytes, -32,768 to + 32,767) : Small Int « Data Type « SQL / MySQL






SMALLINT(m): 16-bit integer (2 bytes, -32,768 to + 32,767)

   
mysql>
mysql> CREATE TABLE a (
    ->  id INT NOT NULL AUTO_INCREMENT,
    ->  choice SMALLINT NOT NULL,
    ->  ts TIMESTAMP,
    ->  PRIMARY KEY (id));
Query OK, 0 rows affected (0.00 sec)

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

mysql>

   
    
    
  








Related examples in the same category

1.Define and use small int
2.Use smallint to store year
3.CREATE TABLE statement including two column definitions, SMALLINT data type and INT data type.
4.SMALLINT data type and a default value of 1
5.SmallInt calculation
6.Compare smallint value