When we use a relational database system, we should know some important things. Numeric data type is very essential for a table. Here I describe some important points of Numeric Data type in MySQL:
MySQL has 9 numeric data types
- Integer: TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT
- Floating Point: FLOAT, DOUBLE
- Fixed Point: DECIMAL
- Other: BIT, (ENUM maybe)
Some poor design:
- INT(1)
- BIGINT AUTO_INCREMENT
- no UNSIGNED used
- DECIMAL(31,0)
INT(1) – 1 does not mean 1 digit. (1) represents client output display format only. INT is 4 Bytes. TINYINT is 1 Byte …
[Read more]