当前位置:网站首页>MySQL learning notes - data type (2)

MySQL learning notes - data type (2)

2022-07-04 15:32:00 Murshaw 756

Catalog

6、 Date and time type

6.1 YEAR type

6.2 DATE type

6.3 TIME type

6.4 DATATIME type

6.5 TIMESTAMP type

6.6 Development experience  

7、 Text string type

7.1 CHAR type

7.2 VARCHAR type

7.3 TEST type

8、ENUM type  

9、SET type

10、 Binary string type

10.1 BINARY and VARBINARY type

10. 2 BLOB type

11、JSON type

12、 Type of space

13、 Summary and selection suggestions


6、 Date and time type

6.1 YEAR type

 

6.2 DATE type

6.3 TIME type

6.4 DATATIME type

6.5 TIMESTAMP type

 

TIMESTAMP and DATATIME difference

6.6 Development experience  

7、 Text string type

 

7.1 CHAR type

  Be careful :1、 A Chinese only takes up one character , Three bytes

2、INSERT INTO test_char1(c1) VALUES('ab   ');  The spaces you add will also be removed from the trailing spaces .

7.2 VARCHAR type

How to choose CHAR perhaps VARCHAR

7.3 TEST type

Be careful :TEST When using type , The spaces you add will not be deleted , So in use SELECT CHAR_LENGTH(tx) FORM test_test; When , The length will add its own space

Development experience :

8、ENUM type  

 

1、 Enum add ignore case

2、 You can use index ( Subscript ) Call enumeration elements

3、 There is no limit to non empty cases , You can add NULL

9、SET type

 

10、 Binary string type

10.1 BINARY and VARBINARY type

 

 

BINAR Fixed length , therefore LENGTH Is the specified length  

10. 2 BLOB type

Blob Type can use resource type as variable . for example img, You can insert data manually

TEXT and BLOB Precautions for use of :

 

11、JSON type

 

12、 Type of space

 

13、 Summary and selection suggestions

additional :

 

原网站

版权声明
本文为[Murshaw 756]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041403442439.html