Course B · Module B1 Production · Lesson 2 of 18
Understand where your app's data actually lives — and look at it without breaking anything.
Your app is more than screens and buttons. Behind every form submission, every user account, every order — there is a database storing the real thing. Most founders treat it as a black box and hope the AI wired it up correctly. That's fine for a prototype, but not for production. Your single win today: by the end you'll be able to open your database, read what's in it, and understand its structure well enough to spot a problem before it becomes a customer complaint.
Picture a set of Google Sheets, except instead of you opening them, your app opens them automatically every time someone clicks a button. A user signs up — a new row appears in the "users" sheet. They place an order — a new row appears in the "orders" sheet. They update their address — that row changes. Your app is constantly reading and writing to these sheets in the background.
That "smart spreadsheet system" is the database. The individual sheets are called tables. The columns are fields. Each row is a record.
users, orders, products. Each table has one job.email, created_at, total_price. The column's type (text, number, date) is enforced.Notice that last point about IDs. Tables refer to each other rather than duplicating data. An order doesn't store the customer's name and email — it stores their user ID, and the app looks up the rest when needed. This is called a relational database, and it's what Supabase, PlanetScale, and most app-builder backends give you by default.
If you built your app in Course A with a tool like Supabase, Lovable, or Replit, a Postgres database was created for you automatically. You can see it — and that's the most useful thing you can do today.
The place to start is always reading, not writing. Open the Table Editor, look at the rows your app has created, and ask yourself: does this look right? Are there rows I'd expect that aren't there? Are there unexpected nulls (empty fields) where there should be data? This kind of quick visual check catches whole categories of bugs that would otherwise take hours to diagnose through code.
You can edit rows directly in the database dashboard. This is sometimes the fastest way to fix a customer problem ("their account is stuck in a bad state — let me manually correct that field"). But it bypasses all the checks your app code normally runs, so a wrong edit can leave data in an inconsistent state.
The fail-safe for all of this is a backup. Supabase takes automatic daily backups on paid plans. Before any significant manual edit on a live database, confirm a recent backup exists — or trigger one manually first. That way a bad edit is annoying rather than catastrophic.
You don't need to learn SQL (the language databases speak), but one command will serve you well in every debugging session:
SELECT * FROM orders WHERE user_id = 4821 ORDER BY created_at DESC LIMIT 10;
Read it aloud: "Show me all columns from the orders table, for the user with ID 4821, newest first, ten rows maximum." That's it. Paste this into Supabase's SQL editor, swap in the table name and the ID, and you can inspect any user's records in about thirty seconds. Your AI tool can write the exact query for your schema — just describe what you're looking for in plain English.
Answer before opening — recalling it is what makes it stick.
Open the database and look at the orders table for their user ID. Before changing any code, check whether the row actually exists — it might be a data problem (the record was never created or was created with the wrong user ID) rather than a display bug. Read first, then diagnose.
A table is the whole sheet — for example, all orders; a row is a single entry in that sheet — one specific order. Tables hold all records of one type; each row is one instance of that type.
To avoid duplicating data. If a user changes their email, you'd have to update every order row. Storing just the ID means the user's profile is the single source of truth — orders just point to it. This is the relational model.
Read this next (primary source)
Database Overview — Supabase Docs. The clearest plain-English introduction to the database that most AI-built apps use. Covers tables, rows, the SQL editor, and the Table Editor UI. ~10 min. See RESOURCES.md for more.
New terms from this lesson — database, table, record, SQL — are in the course glossary. Keep it open as you go.