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 only updated, deleted , inserted records after certain interval time in mysql with out using triggers...

2009


How do I copy a table in mysql workbench?

632


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

657


How do I export mysql query results to excel?

694


How do I run mysql without installing?

671


What is difference between mysql mysqli and pdo?

638


What are the types of index?

687


How do I change the max connections in mysql?

624


Does mysql scale well?

670


What is csv?

705


What is a session in mysql?

683


What does mysql workbench do?

643


Is sql similar to mysql?

648


Is null in mysql?

638


What is the size of mysql database?

676