What is the difference between char and varchar data types?
Answer Posted / paras nath
The char is a fixed-length character data type, the varchar is a variable-length character data type.
Because char is a fixed-length data type, the storage size of the char value is equal to the maximum size for this column. Because varchar is a variable-length data type, the storage size of the varchar value is the actual length of the data entered, not the maximum size for this column.
You can use char when the data entries in a column are expected to be the same size.
You can use varchar when the data entries in a column are expected to vary considerably in size.
| Is This Answer Correct ? | 53 Yes | 7 No |
Post New Answer View All Answers
Explain triggers and stored procedures?
How to create table with same structure of student table in mysql?
What is a scalar function?
What is 'mysqld'?
How do I copy an entire mysql database?
What are the limitations of mysql?
Where MyISAM table will be stored and also give their formats of storage?
What is data type for image in mysql?
What is pdo connection?
How do I install mysql on windows 7?
How to filter data from a mysql database table with php?
What is default schema in mysql?
What is mysql in dbms?
Write a query to display current date and time?
How do I show all mysql databases?