Basic mysql Data Type, mysql Data Type
Big Data Type
Create table data (fti TINYINT, fsi SMALLINT,
Fmi MEDIUMINT, fi INT, fbi BIGINT );
Int type
Create table data1 (age INT (7 ));
Float Type
Create table data2 (price FLOAT (5, 2 ));
Insert into data2 VALUES (13.1), (14.567 );
Query results: retain the last two decimal places
SELECT * FROM data2;
Char type
Create table data3 (sname CHAR (10 ));
Insert into data3VALUES ('wers'), ('ertdsasdfggh ');
SELECT * FROM data3;
Not enough space to complete, redundant automatic Truncation
Time type:
Create table data4 (birthday DATE );
Insert into data4 VALUES ('2017-03-05 '), (2015 );
SELECT * FROM data4;
Enum type
Create table data5 (gender ENUM ('M', 'F '));
Insert into data5VALUES ('M'), ('M'), ('F'), ('yy'), (NULL );
SELECT * FROM data5;
Select count (*) FROM data5 WHEREgender = 'M ';
Copyright statement: original post of the blogger. For details, refer to the source. Http://blog.csdn.net/dzy21