What is the difference between char and varchar data types?

Answer Posted / preeti singh

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 ?    90 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we store pdf files in mysql?

477


How many columns can a table have?

490


What do you need to connect php to mysql?

530


What is deterministic in mysql?

512


What is max_used_connections in mysql?

490






What are the differences between char and nchar?

537


What is delimiter in mysql trigger?

532


How to display odd rows in student table in mysql?

472


what is the difference between gui testing and database testing? : Mysql dba

527


How do I create a stored procedure in mysql?

497


What is session variable in mysql?

503


How to display top 10 rows in mysql?

580


What is data type for image in mysql?

457


Explain about reporting services of MYSQL?

611


Is mysql a odbc?

475