Skip to content
BENIBIX Learn

Database Schema

Development🗃️ DatabasesDatabase Basics

Also known as Schema

The plan of a database. It lists the tables, columns, types and links.

Think of it like

Think of it like the floor plan of a house. It shows every room and door before anyone moves in.

Example

Emma draws her schema before she writes code. It has customers, orders and products, with an arrow for each link.

Why it matters

The schema shapes everything built on top. Fixing a bad one later means moving real data.

Definition

A database schema is the plan for how a database is laid out. It lists the tables, their columns, the types and the links between them. It says what shape the data must have, before any data goes in. The database refuses anything that does not fit the plan. To change the plan later, you use a migration. A good schema makes the app simpler, and a bad one makes each feature harder.

Common mistake

Changing the schema by hand on the live server. Use a migration, so every copy of the database changes the same way.

Key takeaways

  1. 1
    The plan. Tables, columns, types, links.
  2. 2
    Enforced. Data that does not fit is refused.
  3. 3
    Change with care. Use migrations, not hand edits.

Compare