Mega Code Archive

 
Categories / MySQL Tutorial / Data Types
 

CHAR and VARCHAR

VARCHAR is a variable length and the CHAR is not. CHAR types are used for fixed lengths. If you declare a CHAR(10), all values stored in this column will be 10 bytes long, even if it is only 3 characters long. MySQL pads this value to fit the size that was declared.