Solve “Deduplicate events with ROW_NUMBER”

Free. Runs in your browser, no install.

SQL · NULL Handling & Data Types

CHAR vs VARCHAR vs TEXT

Easycharvarchartextdata types

Interview question

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

How to answer

CHAR

Fixed-length string.

Output
CHAR(10)

Good when values have predictable fixed length.

VARCHAR

Variable-length string with a defined maximum.

Output
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

Lock it in with a real drill

You remember an answer longer once you have used it. Try a hands-on problem on this concept.

Open related drill