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

How to get a version of mysql?

528


What is the difference between MyISAM Static and MyISAM Dynamic?

583


Is there a free mysql?

488


Can we write pl sql mysql?

500


explain GROUPBY & HAVING clause with examples.

1830






How internally data stores in MyISAM and INNODB table types?

2087


How do I install mysql on windows 10 64 bit?

465


What is the difference between the primary and unique key in mysql?

457


How can we get total number of records by query in mysql?

488


How do I make an action query?

477


I want to insert userid of a customer,order time,etc in a table called ordermaster with orderid as primary key.Same time the product codes and required quantities (a1,2 and a2 4 and so on)inserted in another table orderdetails with same orderid reference.How the code will be in JSP using MySQL?

1483


How can we run batch mode in mysql?

536


What are the column comparisons operators?

619


Write a command to view mysql database table structure?

529


What is a left join mysql?

470