What is the difference between char and varchar data types?

Answer Posted / dinesh goyal

char is used for fixed length memory storage whereas varchar
is used for variable lenght memory storage.
Fox Example if we have char(10) then we can store 10 bit
value in it but if we store only 6 bit value in it then rest
of the 4 bit space is goes wasted. this limitation is
overcome by varchar.
In varchar if we use less space than define space the rest
of space is not wasted.

Is This Answer Correct ?    363 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is max_used_connections in mysql?

479


How to print message in mysql trigger?

994


How much does mysql enterprise cost?

481


What is a blob datatype?

447


How is data stored in mysql?

494






What are the indexes in mysql?

500


Why MySQL is used?

565


Is mysql a scripting language?

465


What are the different column comparison operators in mysql?

480


In how many ways we can retrieve the data in the result set of MySQL using PHP? What is the difference between mysql_fetch_object and mysql_fetch_array ?

530


How to extract a unit value from a date and time?

491


Write a command to view mysql database table structure?

529


What is ISAM?

687


Why do we use preparedstatement?

483


How can you take the backup and restore a mysql database using php?

479