Data

schema

/ SKEE-muh /

A schema is the blueprint of your data: it spells out what tables exist, what fields (columns) each one has, what type of value goes in each field, and the rules they must follow. It's the shape your data agrees to take before you store a single row.

Say you have a users table — the schema declares that every user has an id (a number), an email (text, and it must be unique), and a created_at (a date). Try to save a user with no email, or a price of 'banana' where a number belongs, and the database politely refuses. That guardrail is the schema doing its job.

A good schema is quietly powerful: it catches mistakes early and keeps your data trustworthy. Changing it later (a 'migration') is real work, so it's worth a little thought up front.

CREATE TABLE users (
  id    INTEGER PRIMARY KEY,
  email TEXT NOT NULL UNIQUE,
  age   INTEGER
);

A tiny schema: three columns, with rules baked in.

Pronounced 'SKEE-muh'; the plural is 'schemas' (or 'schemata' if you're feeling fancy).

Also called
data modeltable definitionstructure