VARCHAR stores text values whose lengths vary. Unlike CHAR, it uses space for the value rather than the column’s entire defined length, making it a practical choice for names such as category labels. section 18.1.1
For predictable table design, give VARCHAR a maximum length. A column declared as varchar(20) allows category names up to 20 characters and avoids relying on an inefficient database-specific default. section 18.1.1
A category table
CREATE TABLE category defines CategoryID as int and CategoryName as varchar(20). In plain English, the table stores a numeric identifier alongside a text category name limited to 20 characters. Running the statement creates the table without returning result rows; a successful database interface reports completion separately. section 18.1.2
CREATE TABLE category (
CategoryID int,
CategoryName varchar(20)
);
Use this complete CREATE TABLE example to see VARCHAR applied beside an integer column and the required parentheses and comma-separated definitions. section 18.1.2



