What is the difference between char and varchar data types?

Answers were Sorted based on User's Feedback



What is the difference between char and varchar data types?..

Answer / 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

What is the difference between char and varchar data types?..

Answer / 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

What is the difference between char and varchar data types?..

Answer / paras nath

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

What is the difference between char and varchar data types?..

Answer / sonu kumar

i m totally aggred with answer no 1 so my answer will be also like that

Is This Answer Correct ?    1 Yes 2 No

What is the difference between char and varchar data types?..

Answer / deven verma

char stores only character values whereas varchar can
stores alphanumerics values. searching is faster in char in
comparision of varchar

Is This Answer Correct ?    53 Yes 80 No

What is the difference between char and varchar data types?..

Answer / kav

no

Is This Answer Correct ?    40 Yes 88 No

Post New Answer

More MySQL Interview Questions

Explain the difference between primary key and candidate key in mysql?

0 Answers  


ru compare the 2 null values?

2 Answers   ACC,


How to give user privilages for a db. Login as root. Switch to the mysql db. Grant privs. Update privs.

0 Answers  


Can mysql store files?

0 Answers  


What is deterministic in mysql?

0 Answers  






A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?

5 Answers  


What is general log in mysql?

0 Answers  


What is the password of mysql?

0 Answers  


What is mysql in linux?

0 Answers  


Can we use mysql and mysqli together?

0 Answers  


What are the advantages and disadvantages of using mysql?

0 Answers  


How do I disable mysql?

0 Answers  


Categories