Common data types

MySQL data types: numeric, character, date and time types
numeric:
1, plastic
tinyint, smallint, mediumint, int, bigint
range of possible decision
common: BIGINT, tinyint, int
2, floating point type
float, double

3, the fractional
decimal (M, D) (used) (decimals may be stored, M: the length of storage may be excluded decimal value, D: number of decimal places)
as: 100.32 decimal (5,2)


Character:
. 1, char (common)
2, VARCHAR (common)

3, text (large storage space, try not to use)
. 4, BLOB (binary)

5, enum (enumeration, one of many)


6, set (multiple choice and more)

 

 


Date and Time Types
1, year

2、date

3、time

4, datetime (5.5 no)

5, timestamp (timestamp)

note

1, unsigned (signed or unsigned) ZEROFILL (digital type length prevail, less filling 0) forms
2, MySQL data length exceeds a predetermined length of data taken discard excess (SQLYog (Note: non-strict model, MySQL strict mode default ) can not use the command line)
3, the user is automatically incremented value can be specified in the statement, id a maximum of 5, it will automatically incremented value 6
4, the data type of a length only zerofill an impact greater than a set may be filled a predetermined length
such as int (3) may insert data 4444

 

Setting database character set
server-level database-level table level field level

 

 

Guess you like

Origin www.cnblogs.com/zhuyunlong/p/11870957.html