Skip to content
BENIBIX Learn

Database Table

Development🗃️ DatabasesDatabase Basics

Also known as Table, SQL Table

One kind of data in a database. It is set out in rows and columns.

Think of it like

Think of it like a class list. Each pupil gets a line, and each line has the same boxes to fill.

Example

Jack's shop has a customers table and an orders table. Each order row points to the customer who placed it.

Why it matters

Tables give data a fixed shape. That shape is what makes searching and checking it reliable.

Definition

A table is where a database keeps one kind of thing, like customers or orders. It has columns, which say what each record holds, and rows, which are the records. Every row in a table has the same columns. A database usually has many tables that point to each other. Choosing good tables is the first step in designing a database.

Example code

sql
CREATE TABLE customers (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  city TEXT
);
A table with three columns, ready for rows.

Common mistake

Putting all your data in one huge table. Orders, customers and products each want their own.

Key takeaways

  1. 1
    One kind of thing. Customers here, orders there.
  2. 2
    Same columns. Every row has the same boxes.
  3. 3
    Tables link up. Keys point from one to another.

Compare