mysql various sizes of data types and lengths

Numeric

Types of
size
Range (signed)
Range (unsigned)
use
TINYINT
1 byte
(-128,127)
(0,255)
Small integer values
SMALLINT
2 bytes
(-32 768,32 767)
(0,65 535)
Large integer values
MEDIUMINT
3 bytes
(-8 388 608,8 388 607)
(0,16 777 215)
Large integer values
INT or INTEGER
4 bytes
(-2 147 483 648,2 147 483 647)
(0,4 294 967 295)
Large integer values
BIGINT
8 bytes
(-9 233 372 036 854 775 808,9 223 372 036 854 775 807)
(0,18 446 744 073 709 551 615)
Maximum integer value
FLOAT
4 bytes
(E + -3 402 823 466 494 351 38,1.175 E-38) 0, (E-1175 494 351 823 466 351 E 38,3.402 + 38)
0 (E-1175 494 351 823 466 38,3.402 E + 38)
Single-precision
floating-point value
DOUBLE
8 bytes
(1,797 693 134 862 315 7 E + 308,2.225 073 858 507 201 4 E-308) 0 (2,225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E + 308)
0 (2,225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E + 308)
Double-precision
floating-point values
DECIMAL
Of DECIMAL (M, D), if M> D, M + 2 is otherwise D + 2
Depending on the value of M and D
Depending on the value of M and D
Small value


Character Types

CHAR
0-255 bytes
Fixed-length string
VARCHAR
0-255 bytes
Variable-length strings
TINYBLOB
0-255 bytes
No more than 255 characters in binary string
TINYTEXT
0-255 bytes
Short text strings
BLOB
0-65535 bytes
Long text data in binary form
TEXT
0-65535 bytes
Long text data
MEDIUMBLOB
Bytes 0-16777215
Binary text data in the form of medium length
MEDIUMTEXT
Bytes 0-16777215
Medium length text data
LOGNGBLOB
0-4294967295 bytes
Great text data in binary form
LONGTEXT
0-4294967295 bytes
Great text data

 

Enumerations

 

Types of
Size
(bytes)
The maximum number of members
ENUM
64
65535
SET
64
64

 

Time Type

Types of
Size
(bytes)
range
format
use
DATE
3
1000-01-01/9999-12-31
YYYY-MM-DD
Date values
TIME
3
'-838:59:59'/'838:59:59'
HH:MM:SS
Time value or duration
YEAR
1
1901/2155
YYYY
Year Value
DATETIME
8
1000-01-01 00:00:00/9999-12-31 23:59:59
YYYY-MM-DD HH:MM:SS
Date and time value mixing
TIMESTAMP
8
1970-01-0100: 00: 00/2037 sometime years
YYYYMMDD HHMMSS
Mixing date and time value, the time stamp

Guess you like

Origin www.cnblogs.com/little-fly/p/11183405.html