CHAR & VARCHAR
Learn CHAR & VARCHAR (Data Types, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Introduction CHAR(n) is fixed length, right-padded with spaces (padding stripped on read). VARCHAR(n) is variable length and stores a 1 or 2 byte length prefix plus the actual bytes. n counts characters, not bytes.