If you already build reports in Excel, SQL is the next useful step because it lets you ask the same kinds of questions directly from tables: Which orders match this condition? How much did each customer buy? Which results should appear in the final report? You do not need to master all of SQL at once. A small set of ideas — SELECT, WHERE, and GROUP BY — already covers a lot of everyday analyst work.
This primer is a first orientation, not job-readiness and not a live SQL environment. By the end, you should be able to look at a simple business question and decide whether you need to list rows, filter rows, or summarize rows.
Imagine this fictional orders table:
| order_id | order_date | customer | region | product | quantity | unit_price |
|---|---|---|---|---|---|---|
| 1001 | 2026-01-03 | Acorn Co | East | Notebook | 5 | 12.00 |
| 1002 | 2026-01-03 | Bright Ltd | West | Pen | 10 | 2.50 |
| 1003 | 2026-01-04 | Acorn Co | East | Pen | 20 | 2.50 |
| 1004 | 2026-01-05 | Delta Inc | South | Chair | 2 | 85.00 |
| 1005 | 2026-01-06 | Bright Ltd | West | Notebook | 3 | 12.00 |
| 1006 | 2026-01-06 | Acorn Co | East | Chair | 1 | 85.00 |
A common first business question is: “Show me all orders from the East region.” In SQL, that becomes:
SELECT order_id, order_date, customer, region, product, quantity, unit_price
FROM orders
WHERE region = 'East';
SELECT chooses columns. FROM names the table. WHERE filters rows before any summaries happen.
The result would be these three rows:
| order_id | order_date | customer | region | product | quantity | unit_price |
|---|---|---|---|---|---|---|
| 1001 | 2026-01-03 | Acorn Co | East | Notebook | 5 | 12.00 |
| 1003 | 2026-01-04 | Acorn Co | East | Pen | 20 | 2.50 |
| 1006 | 2026-01-06 | Acorn Co | East | Chair | 1 | 85.00 |
This is the SQL version of using an Excel filter: you are still looking at individual records, just a smaller set of them.
A second question might be: “Show only notebook orders with quantity at least 4.”
SELECT order_id, customer, product, quantity
FROM orders
WHERE product = 'Notebook' AND quantity >= 4;
Worked result:
| order_id | customer | product | quantity |
|---|---|---|---|
| 1001 | Acorn Co | Notebook | 5 |
A useful habit: before writing SQL, say the question in plain English and underline the condition words like from, only, at least, before, after, or in. Those often map to
WHERE.
Using the table above, what does this query return?
SELECT order_id, customer, quantity
FROM orders
WHERE customer = 'Bright Ltd' AND quantity >= 5;
The query filters individual rows, so both conditions must be true on the same row. Order 1002 matches because it is Bright Ltd with quantity 10. Order 1005 is Bright Ltd but quantity 3, so it fails the quantity >= 5 condition. The answer that includes both Bright rows is a common Excel-to-SQL slip: noticing the customer match but overlooking the second condition. The notebook-focused answer adds a condition that was never asked for. The 'no rows' answer confuses row filtering with aggregation — WHERE works perfectly without GROUP BY.