Optional · Extra credit

SQL for Business: From One Query to Real Analysis

About 3 to 5 hours, at your own paceBuilds on Lab 7 →

Lab 7 showed you that you can ask a database a question. One week is enough to learn that, and not enough to learn what analysts do with SQL every day. This bootcamp is the rest of it: joining several tables at once, grouping and filtering groups, working with dates, labeling rows, breaking a hard question into steps, and comparing each row with the ones around it. You work on the same Cascadia database, in your browser, with nothing to install.

WhyWhy SQL is worth a weekend

Almost every company keeps its operating data in databases, not spreadsheets. Sales, inventory, customers, payroll, website clicks: systems write them to tables like the ones in Lab 7, all day. A spreadsheet is a copy someone exported, already shaped by what they guessed you would ask. SQL is how you ask the database yourself.

That changes your work in three ways. You stop waiting. A question that would take a request to IT and a week can take five minutes. You can check. When two reports disagree, you can go to the source and find out why. You can ask what nobody planned for. Most useful findings come from questions no report was built to answer, like Lab 7's sales with no member attached.

SQL is also unusually durable. It has been the common language of databases since the 1970s, and it is still how you query cloud data warehouses and many analytics tools. What you learn here carries over, with small changes, to most of the systems you will meet.

Where you would use it

Marketing: which customers bought once and never came back. Finance: why this month's revenue report and the accounting system disagree. Operations: which stores are below their reorder point right now. HR: turnover by department and manager. MIS: confirm a system upgrade loaded every order and lost none. Business analytics: pull the exact data a model or dashboard needs, straight from the database. Each one is a query or two.

Contents Why  ·  Sandbox  ·  1 · Reading a table  ·  2 · Adding things up  ·  3 · Joins  ·  4 · Dates and CASE  ·  5 · Queries inside queries  ·  6 · Window functions  ·  Capstone  ·  Certificate

Wanna go analog?or save it as a PDF; the navigation drops out

Who this is for, and what you get

It is optional. If Lab 7 made sense and you want a skill that shows up in a lot of business job postings, this is it. You learn in 35 short steps, one idea at a time, and you write every query yourself. Pass every step, write a short memo, and email your certificate to Professor Califf (califfc@wwu.edu). Each bootcamp you finish adds 2 points to the exam of your choice; say which exam in your email. Do it in several sittings; your progress saves in this browser.

It is also something you can put on a resume. One honest way to say it: Completed a 35-step SQL bootcamp (joins, aggregation, CTEs, window functions) on a 2,899-row retail database. The resume page shows where a line like that goes.

Green · AI as coach

Ask an AI to explain an error message, or what a keyword does, or why your query returns more rows than you expected. Then fix the query yourself. Do not ask it to write the query for a step. Writing them is the skill, and the certificate says you have it.

The tables you will use

sales(sale_id, sale_date, store_id, product_id, member_id, quantity, unit_price) · stores(store_id, store_name, region, opened_year, square_feet) · products(product_id, product_name, category, supplier_id, unit_cost, list_price) · suppliers(supplier_id, supplier_name, country, lead_time_days) · members(member_id, first_name, last_name, city, state, member_type, join_date) · inventory(store_id, product_id, quantity_on_hand, reorder_point) · used_gear(item_id, product_id, store_id, condition, listed_price, date_listed, date_sold)

One rule for the whole bootcamp: revenue is quantity * unit_price from the sales table. The unit_price on a sale is what the customer actually paid, which is not always the list price.

ToolThe sandbox: your scratch space

The dark box below is not a step, and nothing you type in it is graded. Use it to look at a table before you write a step's query, or to try an idea. Press Dock and it follows you down the page.

Sandbox · tool, not a step

Loading database…

The sandbox is docked. Press Undock on it to put it back here.

The SQL cheat sheet: every word this lab uses, plus a few more, all runnable

Every example below runs in the sandbox as written. The four groups are the order the lessons use them in. Come back here whenever a word looks unfamiliar.

1. Getting data out: SELECT and FROM. Every query starts with these two. The star means all columns; naming columns keeps the result narrow; DISTINCT means each value once.

SELECT * FROM stores;
SELECT store_name, region FROM stores;
SELECT DISTINCT category FROM products;

2. Keeping some rows: WHERE. Compare with =, >, <, and <> (not equal). LIKE matches a pattern, where % means "anything here." AND needs both conditions true; OR needs either. Text goes in single quotes; numbers do not.

SELECT product_name, list_price FROM products WHERE list_price < 30;
SELECT product_name FROM products WHERE product_name LIKE 'Ridgeline%';
SELECT COUNT(*) FROM sales WHERE store_id = 4 AND quantity > 2;
SELECT COUNT(*) FROM sales WHERE store_id = 5 OR store_id = 8;

3. Sorting and stopping: ORDER BY and LIMIT. ORDER BY sorts smallest first unless you add DESC. LIMIT stops after that many rows, and it always goes last.

SELECT product_name, list_price FROM products ORDER BY list_price DESC LIMIT 5;

4. Adding things up: COUNT, SUM, AVG, MIN, MAX, and GROUP BY. On their own, these turn a whole table into one number. Add GROUP BY and you get one number per group, which is a pivot table in words.

SELECT AVG(list_price) FROM products;
SELECT MIN(list_price), MAX(list_price) FROM products;
SELECT category, COUNT(*) FROM products GROUP BY category;
SELECT store_id, SUM(quantity * unit_price) FROM sales GROUP BY store_id;

Then JOIN, which Steps 5 and 6 teach on their own, because it is the one idea here with no spreadsheet equivalent.

How the steps work

Each step teaches one small idea, then gives you a task. Write the code in the box and press Run and check. If it is right, the next step opens. If not, you get a note on what to fix. Every step has a hint, and after two tries you can see a solution. There is no penalty for wrong tries.

Your progress and your code save in this browser, so you can stop and come back. In the code box, Tab adds an indent; press Esc and then Tab to move on. To start over, use the button.

Progress: 0 / 35 steps

    1Reading a table

    The ask · from the Purchasing Manager

    “I am new here. What stores do we run, what do we sell in Water and under $50, and what are our five most expensive items?”

    The decision it feeds: Getting oriented before the first reorder review.

    2Adding things up

    The ask · from the Finance Lead

    “I need 2025 revenue for the annual report: the total, each store, and the average price in each category.”

    The decision it feeds: The numbers in the annual report.

    3Joins

    The ask · from the Purchasing Manager

    “Which suppliers do we depend on most? What is below its reorder point right now? And how much revenue comes from customers with no membership?”

    The decision it feeds: Supplier talks, today's orders, and how hard to push memberships.

    4Dates and CASE

    The ask · from the Marketing Lead

    “Should promotions run on weekends? Is our product mix mostly budget or premium? And how long does used gear sit before it sells?”

    The decision it feeds: When promotions run, and which price tier to feature.

    5Queries inside queries

    The ask · from the Finance Lead

    “Big stores always win on revenue. Which store earns the most per square foot? And which products are priced above our average?”

    The decision it feeds: Which stores get remodel money.

    6Window functions

    The ask · from the General Manager

    “For the board: rank our products by price, show which months grew over the month before, and show how the year added up.”

    The decision it feeds: The story the board hears, and next year's monthly targets.

    CapstoneCapstone

    The Used Gear Program Lead asks how to price by condition. No worked query.

    FinishYour memo & certificate

    Red · Your memo, your words

    Write the memo yourself. Do not ask an AI tool to write it, rewrite it, or clean it up. It is the part that shows how you think.

    Your reply to the Used Gear Program Lead

    In a short memo, tell the program lead what you found about time to sell by condition, and whether it supports the hunch. Then name one thing you would check before anyone changes the price sheet, and write the query you would use to check it (in words is fine).

    Fifty words is the minimum. This prints as page 2 of your certificate.

    0 words

    All steps passed

    Put your name in exactly as it appears in Canvas, then download your certificate. The code on it is generated from your name, so it is yours and nobody else's.

    EmailHow to get your points

    Email your certificate PDF to Professor Califf at califfc@wwu.edu. Put the bootcamp’s name in the subject line and say which exam you want the 2 points on. Your memo prints on page 2, so the certificate is the only file you need to send.

    This quarter’s deadline: December 6, 2026, at 11:59 pm. After that, the bootcamp stays up for free, so you can still do it for the skills.