Setting M to a higher value than the type allows will not allow you to extend its limit. : Tiny Int « Data Type « SQL / MySQL






Setting M to a higher value than the type allows will not allow you to extend its limit.

      
mysql>
mysql> CREATE TABLE test2(id TINYINT(10));
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> INSERT INTO test2(id) VALUES(100000000);
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql>
mysql> SELECT id FROM test2;
+------+
| id   |
+------+
|  127 |
+------+
1 row in set (0.00 sec)

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

   
    
    
    
    
    
  








Related examples in the same category

1.Define and use tiny int
2.TINYINT(m) 8-bit integer (1 byte, -128 to +127);
3.Tinyint as column type