Numeric Column Types : Data Type Summary « Data Type « SQL / MySQL






Numeric Column Types

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

mysql>
mysql> INSERT INTO test1 VALUES(3);
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> INSERT INTO test1 VALUES (-1);
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql>
mysql> INSERT INTO test1 VALUES (256);
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql>
mysql> SELECT * from test1;
+------+
| id   |
+------+
|  003 |
|  000 |
|  255 |
+------+
3 rows in set (0.00 sec)

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

   
    
    
    
    
    
  








Related examples in the same category

1. Data Types in MySQL
2.The fractional data types
3.Binary data types support the storage of large amounts of data, such as image and sound files.
4.Integer Types in MySQL with Sizes and Ranges