Depend on MySQL 8.0 、 PostgreSQL 11.0
data types
Attributes of any data types:
- How many bytes ?
- Is it signed ?
- Can it be NULL ?
- Can it be changed ?
- Auto increase ?
default attributes
| MySQL |
PostgreSQL |
UNSIGNED、can be NULL 、can be changed |
--- |
Declaration of data types
MySQL
- Integer
- Bit(n) : n bits
- TINYINT: 1 btye
- SMALLINT: 2 bytes
- MEDIUMINT: 3 bytes
- INT: 4 bytes
- BIGINT: 8 bytes
- No-Integer
- DECIMAL(m,n):store a number with (m-n)-max-length integer part and n-max-length pointed part.
- String
- CHAR(n): fixed-width, using this if data's length is stable
- VARCHAR(n): use one byte or two bytes to store length, using this if data's length is not stable
Depend on MySQL 8.0 、 PostgreSQL 11.0
data types
Attributes of any data types:
default attributes
UNSIGNED、can beNULL、can be changedDeclaration of data types
MySQL