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

How do I rename a table in mysql?

503


What are aggregate functions in mysql?

681


How do I restore a mysql database?

543


What is difference between statement and preparedstatement?

481


how you will Create a database on the mysql server with unix shell.

562






Explain what is mysql?

591


Can we store images in mysql database?

484


How to enter boolean values in sql statements?

545


How can I create a database in mysql?

471


What is difference between mongodb and mysql?

469


How do I install the latest mysql on ubuntu?

492


How to allow the user "sonia" to connect to the server from localhost using the password "passwd". Login as root. Switch to the mysql db. Give privs. Update privs.

602


Can mysql and mariadb coexist?

582


How to show all records starting with the letters 'sonia' and the phone number '9876543210'

523


What is 'mysqlimport'?

523