Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. CHAR vs VARCHAR vs TEXT

SQL · NULL Handling & Data Types

CHAR vs VARCHAR vs TEXT

Easysql-30
charvarchartextdata types

Question

What is the difference between CHAR, VARCHAR, and TEXT?

Solution

CHAR

Fixed-length string.

CHAR(10)

Good when values have predictable fixed length.

VARCHAR

Variable-length string with a defined maximum.

VARCHAR(100)

Common for names, emails, etc.

TEXT

Variable-length text type intended for larger/unbounded-ish textual data, depending on database.

Exact storage/indexing behavior varies by database.

Interview shortcut:

> CHAR = fixed length > VARCHAR = variable length with limit > TEXT = large text

🎯 Put this concept into practice

Solidify this answer with real hands-on interview drills in the browser studio.

Open related drill →
PreviousNext