In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will give you a detailed explanation of char in mysql. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Introduction to char
In MYSQL, the field type char refers to a string represented by a fixed length of a specified length; for example, char (8), the database will use a fixed 1 byte (eight bits) to store data, with less than 8-bit strings followed by blank characters.
Features:
The storage space is fixed.
The internal storage is filled with spaces when the length is not enough.
If there is a space at the end of the field itself, the trailing space is automatically truncated when retrieved (because it is not clear whether the space is contained in the field or filled in).
If there is a space in front of the field itself, it will not be truncated.
When the character length entered exceeds the specified length, char intercepts the characters that exceed the specified length.
For example, when you define a string with a field type of char (10) and an inserted value of "abc", they occupy 10 bytes of the same space because the remaining 7 positions are filled with spaces.
Applicable:
Suitable for storing strings that are very short or close to the same length.
Char is more efficient in access than varchar because it is of fixed length.
For very short columns, char is also more efficient in storage space than varchar.
About the char in mysql to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.