Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the usage specification of mysql column

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what is the use specification of mysql column". In daily operation, I believe that many people have doubts about what the use specification of mysql column is. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "what is the use specification of mysql column"! Next, please follow the editor to study!

1. Decimal type is decimal, so float and double are prohibited.

Float and double have the problem of loss of accuracy during storage, and incorrect results are likely to be obtained when comparing values.

2. If the stored data exceeds the range of decimal, it is recommended to split the data into integers and decimals and store them separately.

3. Use tinyint/int/bigint by business, accounting for 1-4-8 bytes respectively.

Char/varchar is used according to business.

Example

Demo:mysql > use school; # Select database schoolmysql > create table class6 (class_id integer (5) zerofill, class_name varchar (128), class_teacher varchar (64)); # create table class6 mysql > insert into class0 values (1, 'Class 3, Grade 6', 'Miss Zhang'); mysql > select * from class0 +-+ | id | name | teacher | +-+ | 00001 | Class 6, Grade 3 | Miss Zhang | +-+ 1 row in set (0.00 sec) so far The study on "what is the specification for the use of mysql columns" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report