What is the difference between varchar and nvarchar in SQL ?, Varcharnvarchar
Zookeeper varchar (n)
Variable-length and non-Unicode character data with a length of n Bytes. N must be a value between 1 and 8,000. The storage size is the actual length of the input data bytes, rather than n Bytes.
Nvarchar (n)
Unicode data with a variable length of n characters. The value of n must be between 1 and 4,000. The storage size of bytes is twice the number of input characters.
The two fields have Field Values: Me and coffee.
The varchar field occupies 2 × 2 + 6 = 10 bytes of storage space, while the nvarchar field occupies 8 × 2 = 16 bytes of storage space.
If the field value is only in English, you can select varchar. If the field value contains many double-byte (Chinese, Korean, etc.) characters, use nvarchar.
The above is a summary and can be seen through the above introduction.
Varchar (4) can be 4 or 2 Chinese Characters
Nvarchar (4) can contain four Chinese characters or four letters, but a maximum of four