SQL from Scratch · Day 3 of 60 ·

Tables, rows and columns

Picture a spreadsheet with stricter rules. That’s the quickest way to understand a database table, and tables are where all your data lives.

A table stores one kind of thing. A shop might keep a customers table, a products table and an orders table.

Each column is one piece of information, such as name or city. Every value in a column should be the same kind of data.

Each row is one record. One row in customers is one customer.

customers
name | city
Alex | Lisbon
Ben | Taipei

This table has 2 columns and 2 rows. Alex’s row holds everything we know about Alex, and the city column holds every customer’s city.

The difference from a spreadsheet is discipline. A spreadsheet lets you type anything into any cell. A database table enforces the structure you define, which keeps large amounts of data reliable.

What would you store in your first table?

Join the conversation on LinkedIn