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


Please Help Members By Posting Answers For Below Questions

What do I do if I forgot my mysql root password?

476


What is the use of concat() in mysql?

510


How are mysql timestamps seen to a user?

505


List the different types of normalization?

526


What is datatype in mysql?

473






What is a storage engine?

555


What you can use regular expression for in mysql?

486


What are triggers in mysql?

489


Does mysql use t sql?

572


How to enter numeric values as hex numbers?

531


How to dump a table from a database.

530


What is mysql connection limit?

513


how can you test for null values in a database? : Mysql dba

469


Is mysql free for commercial use?

470


how to search second maximum(second highest) salary value(integer)from table employee (field salary)in the manner so that mysql gets less load?

539