Module 00 · lesson 1

What data is and why we store it in tables

Your first day at GadgetHub — a small online store the founder opened a year ago, right out of their own apartment. Back then it saw a couple of orders a week, and they kept track of products in a plain text file. Now the store is growing — and there's no finding anything in that file anymore. The founder asks you to sort it out.

How it all began

While GadgetHub was tiny, the founder jotted products straight into a notepad:

товари:products: productos: headphones 59 15pcs; phone case - 15 8 in stock 55 акція!sale! ¡oferta! LED desk lamp 25 left 20 19 powerbank20000mah — 35, 5 ціна злиплась із назвою · кількість то спереду, то ззаду · два товари в рядкуprice stuck to the name · quantity front or back · two products per line precio pegado al nombre · cantidad delante o detrás · dos productos por línea

Looks like it's all there. But try to answer quickly:

  • How much does the Powerbank cost? 35 and 5 — which is the quantity and which is the price?
  • Which products have fewer than 10 left?
  • How many products are in the store altogether?

Hard, isn't it? The price runs into the name, the quantity is sometimes in front and sometimes behind, two products share one line. This is data — facts about products — but without structure it's almost useless.

What data is

Data is facts about something real: a product, a customer, an order. On its own, the fact "59" says nothing. But "the price of the headphones is $59" — now that's useful. Data comes alive once it's clear what each fact means.

The solution — a table

Let's sort that same mess onto shelves:

nameprice ($)stock
Headphones5915
Phone case158
LED desk lamp2520
Powerbank 20000 mAh355

Feel the difference? Now:

  • columns — the attributes: name, price, stock, the same for every product;
  • rows — the individual products: one row = one product with all of its data.

And the answers become instant: the powerbank's price is in its row; what's low in stock — you check the stock column; how many products — as many as there are rows.

name price stock Headphones 59 15 Phone case 15 8 LED lamp 25 20 стовпець — характеристикаcolumn — an attribute columna — un atributo рядок —row — fila — один товарone product un producto

The key idea

A table turns chaos into structure: facts of the same kind line up one under another, so they're easy to count, search, and compare. Every relational database is built from tables just like this one — and you've just taken your first step toward it.

Summary

  • A mess in a file becomes useful once the data goes into a table: rows are products, columns are their attributes.
  • Data is facts; structure (a table) is what makes it useful.