The CHAR data type is a fixed-length character data type that can store up to 255 characters.
mysql>
The <length> placeholder specifies the number of characters stored.
mysql>
mysql>
mysql> CREATE TABLE Catalog
-> (
-> ProductID SMALLINT,
-> Description VARCHAR(40),
-> Category CHAR(3),
-> Price DECIMAL(7,2)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> drop table Catalog;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category