What is the difference between CHAR and VARCHAR?

SQL SELECT, filtering and sorting · Freshers and experienced

Model answer

CHAR(n) is fixed length and pads with spaces. VARCHAR(n) is variable length up to n. Use VARCHAR for most text. In some databases (PostgreSQL) TEXT is equivalent in performance.

Learn this topic

SELECT, FROM and WHERE: Your First Queries in the course SQL for Beginners: Learn Databases Step by Step.

Sign in to add your own answer.

More questions