- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between CHAR and NCHAR in MySQL?
Both CHAR and NCHAR are fixed length string data types. They have the following differences −
CHAR Data Type | NCHAR Data Type |
Its full name is CHARACTER. | Its full name is NATIONAL CHARACTER |
It uses ASCII character set | It uses Unicode character set and data is stored in UTF8 format |
It occupies 1-byte of space for each character. | It Occupies 2-bytes of space for each character |
mysql>create table hello1(name CHAR(20)); Query OK, 0 rows affected (0.15 | mysql>create table hello(name NCHAR(20)); Query OK, 0 rows affected (0.61 |
Advertisements