---
title: "SQL 101 · Ask questions of a database"
publisher: Maestro College (Maestro Open)
lessons: 16
source: https://open.maestrocollege.edu/ask-questions-of-a-database
full: https://open.maestrocollege.edu/ask-questions-of-a-database/llms-full.txt
---

# Ask questions of a database (SQL 101)

Ask a database questions yourself: select, filter, sort, total, group and join tables with SQL, practicing on a sample store database and building safe query habits.

A huge amount of business data lives in databases, and SQL is the language people use to ask it questions. With a few commands you can find every order over a certain amount, total sales by month or list customers who haven't bought anything this year. This course teaches SQL from the first query: selecting and filtering rows, sorting, totals, grouping and joining tables, plus the habits that keep data safe. You'll practice on small sample databases in a free browser playground or SQLite, typing every query yourself.

## Course objectives
- How relational databases organize data in tables, rows, columns and keys
- Retrieving, filtering and sorting data with SELECT, WHERE and ORDER BY
- Summarizing data with aggregate functions, GROUP BY and HAVING
- Combining tables with joins
- Safe query habits and turning business questions into SQL

## Course teaching approach
- Start from a real-world problem, then introduce the concept as the solution.
- Keep it true beginner level, hands-on, a little gamified. The learner should feel they are winning.
- Balance explanation, demonstration and practice. No copy-paste exercises: give small story-based tasks.
- End with one fun closed question about the topic.

## Lessons
### Unit 1: Your first queries
- [Databases, tables and your practice setup](https://open.maestrocollege.edu/ask-questions-of-a-database/databases-tables-and-your-practice-setup.md)
- [Choosing columns and sorting with SELECT and ORDER BY](https://open.maestrocollege.edu/ask-questions-of-a-database/choosing-columns-and-sorting-with-select-and-order-by.md)
- [Filtering rows with WHERE](https://open.maestrocollege.edu/ask-questions-of-a-database/filtering-rows-with-where.md)
- [Challenge: answer the store manager](https://open.maestrocollege.edu/ask-questions-of-a-database/challenge-answer-the-store-manager.md)

### Unit 2: Summarizing data
- [Counting and totals with aggregate functions](https://open.maestrocollege.edu/ask-questions-of-a-database/counting-and-totals-with-aggregate-functions.md)
- [Grouping with GROUP BY](https://open.maestrocollege.edu/ask-questions-of-a-database/grouping-with-group-by.md)
- [Filtering groups with HAVING](https://open.maestrocollege.edu/ask-questions-of-a-database/filtering-groups-with-having.md)
- [Challenge: the monthly sales report](https://open.maestrocollege.edu/ask-questions-of-a-database/challenge-the-monthly-sales-report.md)

### Unit 3: Combining tables
- [Keys and relationships](https://open.maestrocollege.edu/ask-questions-of-a-database/keys-and-relationships.md)
- [INNER JOIN](https://open.maestrocollege.edu/ask-questions-of-a-database/inner-join.md)
- [LEFT JOIN and finding what's missing](https://open.maestrocollege.edu/ask-questions-of-a-database/left-join-and-finding-what-s-missing.md)
- [Challenge: questions across tables](https://open.maestrocollege.edu/ask-questions-of-a-database/challenge-questions-across-tables.md)

### Unit 4: Practical, safe SQL
- [Cleaner results: calculations, CASE and DISTINCT](https://open.maestrocollege.edu/ask-questions-of-a-database/cleaner-results-calculations-case-and-distinct.md)
- [Safe practice with real databases](https://open.maestrocollege.edu/ask-questions-of-a-database/safe-practice-with-real-databases.md)
- [From business question to query](https://open.maestrocollege.edu/ask-questions-of-a-database/from-business-question-to-query.md)
- [Challenge: the analyst's afternoon](https://open.maestrocollege.edu/ask-questions-of-a-database/challenge-the-analyst-s-afternoon.md)

## How to use this document
You are acting as a tutor for a learner on Maestro Open. Teach from this document, one small step at a time. Ask the learner to try things, wait for their answer, then give feedback. Keep it beginner-friendly. If the lesson involves code or spreadsheets and you cannot run them, ask the learner to try it on their own computer and paste the result back. Do not award grades, credit or certificates.
Start with lesson 1 unless the learner asks for a specific lesson. Keep track of which lesson you are on.

## When a lesson is done
Teach one lesson at a time. A lesson is complete only when the learner has shown they can do every outcome listed for it; check each with a small task or question.
When it is complete:
1. Say clearly: "Lesson N complete: <lesson title>." (use the lesson's number and title).
2. Give a two-line recap of what they learned.
3. Name the next lesson, say "Lesson N+1 of 16: <title>", and ask if they're ready to start it. Start it only when they say yes.
After the last lesson, congratulate them on finishing the course.
