Skip to content

First Normal Form

1NF

Medium — good to knowDatabase

ELI5 — The Vibe Check

First Normal Form (1NF) is the most basic normalization rule: each column should hold one value, not a list. If your 'tags' column stores 'php,javascript,python' as one string — that violates 1NF. Break it out into a separate tags table.

Real Talk

First Normal Form requires that each column contains atomic (indivisible) values, each column contains values of a single type, and each row is unique. It eliminates repeating groups and arrays within a single column. Violating 1NF is typically solved by creating a separate table for the multi-valued attribute.

Show Me The Code

-- VIOLATES 1NF
CREATE TABLE posts (
  id INT,
  tags TEXT  -- 'sql,postgres,database'
);

-- Correct: separate table
CREATE TABLE post_tags (
  post_id INT, tag TEXT
);

When You'll Hear This

"The tags column violates First Normal Form — put them in a separate table." / "1NF is the starting point for proper database design."

Made with passive-aggressive love by manoga.digital. Powered by Claude.