SQL Text Data Types
VARCHAR, TEXT, and CHAR all hold text — the difference is length limits and padding behavior.
What & Why
VARCHAR(n) holds text up to n characters. TEXT holds text of any length, with no limit declared. CHAR(n) holds exactly n characters, padding shorter values with spaces.
See How It Works
TEXT TYPE BEHAVIOR
| Type | Behavior |
|---|---|
| VARCHAR(50) | Stores up to 50 characters; the campaign names shown here fit. |
| TEXT | Stores text without a declared length limit. |
| CHAR(10) | Stores `Spring` with four trailing spaces so the value occupies 10 characters. |
CHAR pads values to its fixed length. TEXT and VARCHAR are usually safer choices for variable-length business text.
Sign up free to try it on a real business scenario