Ask a new analyst where a customer's region is kept, and many will go looking for a region column in the orders table. It is a reasonable instinct and a wrong one, and the gap between the two is the whole design of a database. A spreadsheet keeps everything about everything in one grid, repeating the customer's details on every order row and letting the copies drift apart over time. A database does the opposite: it splits subjects into tables and connects them with keys, so each fact lives in exactly one place. Analysts who expect one big grid hunt for columns that are not there. Analysts who understand tables follow the pointer to where the fact actually lives.

Before you can ask a database anything, you need to know it the way you would learn a new workplace: who is who, what is kept where, and how the pieces refer to each other.

The grid, table by table

A database is a set of tables. A table is a grid on one subject: one table for customers, one for products, one for orders. Each row is one instance of that subject — one customer, one order. Each column is one fact kept about every instance — a name, a region, a date, a price. Every value in a row belongs to its column's subject, which sounds obvious until the day you meet a real table where someone has been storing notes in the price field. Hold the picture firmly: across a row is one thing's whole story; down a column is one fact about many things.

Consider a small supplier's database of three tables. The customers table holds one row per customer, seven rows in all: Amara Chen in the East, Ben Okafor in the East, Carla Diaz in the West, David Kim in the West, Elena Rossi with her region missing, Frank Novak in the North, and Grace Lee in the North. The products table holds five rows, from a $12 notebook to a $45 desk lamp. The orders table holds fourteen rows, each for a single product, so an order's revenue is simply quantity multiplied by unit price. Small enough to see whole — which is exactly the point. Every claim made about this data can be checked with your own eyes.

Two kinds of key carry the whole of SQL

The first is the primary key: a column, or in some tables a combination, whose value identifies each row uniquely. In the customers table, customer_id does this job. Customer 3 is Carla Diaz, always and only. Names cannot do it — two customers can share a name, change a name, or be typed with a name spelled two ways. The key is the identity; everything else is description.

The second is the foreign key: a column in one table that holds another table's key, and thereby points across. The orders table does not repeat the customer's name, region, and segment on every order. It stores customer_id, the pointer. That is not economy for its own sake. It is what makes the data consistent: Carla Diaz's region is stated once, in one place, so it can never disagree with itself across forty orders. Joining tables, the core skill that comes later, is nothing more than following these pointers.

Expect the imperfections, because they are the data

Read the sample orders closely and you find deliberate imperfections that mirror real tables. Elena Rossi's region is missing. Frank Novak has never ordered. One order — order 13 — has no customer at all; it arrived through a channel that never captured who bought. Order 10 is canceled and order 12 is pending, so "the orders table" and "sales" are not the same set. Order 8's unit price is $11 against a list price of $12: a discount someone gave, recorded in the price actually charged.

None of these are traps set to embarrass you. They are the ordinary texture of business data, placed where you can see them. An analyst who assumes the table is clean will count canceled orders as revenue, drop the customerless order without noticing, and report a region breakdown that quietly omits Elena Rossi. An analyst who has looked at the actual rows knows which questions the data can honestly answer.

Two habits to adopt before your first real query

The first is to count before you query. The first thing to learn about any table is how many rows it has: SELECT COUNT(*) FROM orders returns 14. Every later result is judged against that size. A filter that returns 13 rows from a 14-row table has excluded one row, and you should know which one and why.

The second is to look at the actual values of any column you plan to use. The distinct values of status in the orders table are exactly three — completed, canceled, pending — so filtering on status = 'completed' is safe. Had the table also held "complete," "Completed," and "done," the same filter would have silently missed rows, and the report built on it would have been wrong in a way nobody would notice. On the job, run the distinct-values check on any column before you filter on it. It takes ten seconds, and it is the cheapest insurance in the analyst's toolkit.

One last piece of the picture: values come in kinds — whole numbers, decimal numbers, text, dates — and the kind decides what operations make sense. You can total a price; you cannot total a name. You can ask whether a date falls before April, and the comparison works because dates are stored as dates. Keep the whole picture in view — three tables, keys pointing across them, imperfections visible — and you are ready to start asking questions the data can actually answer.

Experience it, don’t just read about it

The distinction between one big grid and tables connected by keys is Concept 2 of SQL for Business Analysts (Course No. 115), from Cognosco Learning, a learning company powered by AI. The course builds the wider analyst's craft beyond this distinction — SELECT, WHERE, and INNER JOIN — each worked through with an Agentic Socratic AI coach, one learner at a time. Try a Free Preview at cognoscolearning.com.

Try a Free PreviewAll Signature CoursesThe Corporate License

Navigate your own course.

← All Insights

© 2026 Cognosco Learning. All rights reserved.