Home  >  Article  >  Database  >  What is nchar in mysql

What is nchar in mysql

藏色散人
藏色散人Original
2023-04-06 11:22:261839browse

nchar refers to the Unicode character data type in mysql; Unicode character data types include Nchar, Nvarchar, and Ntext; Nchar is defined in the form of "Nchar(n)", which is similar to the Char data type, but different The value of nchar data type is "1~4000".

What is nchar in mysql

The operating environment of this tutorial: Windows 10 system, mysql8 version, Dell G3 computer.

What is nchar in mysql?

nchar is the Unicode character data type. Unicode character data types include Nchar, Nvarchar, and Ntext.

①. Nchar: Its definition form is Nchar(n). It is similar to the Char data type, except that the value of n of the Nchar data type is 1~4000. The Nchar data type adopts the Unicode standard character set. The Unicode standard uses two bytes as a storage unit, and the capacity of one storage unit is greatly increased. It can include all languages ​​​​around the world in one data column. Chinese, English, French, etc. can appear at the same time without encoding conflicts.

②, Nvarchar: Its definition form is Nvarchar(n). It is similar to the Varchar data type. The Nvarchar data type also uses the Unicode standard character set, and the value range of n is 1~4000.

③. Ntext: Similar to the Text data type, the data stored in it is usually characters that can be directly output to a display device. The display device can be a monitor, window, or printer. The Ntext data type uses the Unicode standard character set, so its theoretical capacity is 230-l (l, 073, 741, 823) bytes.

Related recommendations: "MySQL Video Tutorial"

The above is the detailed content of What is nchar in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn