|
1. Number type type
| range
| illustrate
|
| | Char(N) [binary] | N=1~255 characters binary: case-sensitive | Fixed length | std_name cahr(32) not null | | VarChar(N) [binary] | N=1~255 characters binary: case-sensitive | Variable length | std_address varchar(256) | | TinyBlob | Maximum length 255 characters (2^8-1) | Blobs (Binary large objects) store binary data and are case-sensitive
| memo text not null | | TinyText | Maximum length 255 characters (2^8-1) | | Blob | Maximum length 65535 characters (2^16-1) | | Text | Maximum length 65535 characters (2^16-1) | | MediumBlob | Maximum length of 16777215 characters (2^24-1) | | MediumText | Maximum length of 16777215 characters (2^24-1) | | LongBlob | Maximum length 4294967295 characters (2^32-1) | | LongText | Maximum length 4294967295 characters (2^32-1) | | Enum | The maximum number of sets is 65535 | Enumeration, Enum single selection, Set multiselection | sex enum(1,0) habby set ('play video games', 'sleep', 'watch movies', 'listen to music') | | Set | The maximum number of sets is 64 |
Distinguish between Null and Not Null: Null is the null value that allows storage (Null) 2. Numerical values type
| range
| illustrate
| For example
| | TinyInt[M] [UNSIGNED] | -128~127 UNSIGNED : 0~255 |
| num tinyint unsigned | | SmallInt[M] [UNSIGNED] | -32768~32767 UNSIGNED :0~ 65535 |
|
| | MediumInt[M] [UNSIGNED] | -8388608~8388607 UNSIGNED :0~16777215 |
|
| | Int[M] [UNSIGNED] | -2^31~2^31-1 UNSIGNED : 0~2^32 |
|
| | BigInt[M] [UNSIGNED] | -2^63~2^63-1 UNSIGNED : 0~2^64 |
|
| | Float [(M,D)] | -3.4E+38~3.4E+38( approx. )
| Note: M is the length, D is the decimal, Float 4 bytes, Double 8 bytes |
| | Double [(M,D)] | -1.79E+308~1.79E+308( approx. ) | | Decimal [(M,D)] |
|
Identify ZeroFill: Declare the keyword ZeroFill to be auto-filled 0, such as 000021 3. Date and time
type
| range
| illustrate
| | Date | Date (yyyy-mm-dd) |
| | Time | Time (hh:mm:ss) |
| | DateTime | Date and time combination (yyyy-mm-dd hh:mm:ss) |
| | TimeStamp | yyyymmddhhmmss |
| | Year | Vintage yyyy
|
|
|