Welcome to SQL Mastery
SQL is the language every data job runs on. Analysts use it to pull numbers, Power BI and Excel developers use it to shape the data behind their reports, and developers use it to read and change what an application stores. This course takes you from your first query to the window functions, CTEs and query plans that interviewers ask about.
## How the course works
Everything happens in **one practice database**: *TechNet Retail*, a small Indian electronics retailer with customers, products, orders and staff. You load it once in Module 00 and query it in every lesson after that. Because the data never changes underneath you, the answer you get is the answer in the notes.
| Modules | Stage | What you will be able to do | |---|---|---| | 00 | Foundations and setup | Explain what a database is, install PostgreSQL and load the practice data | | 01–02 | Retrieving data | Select, filter, sort and calculate, and use text, number and date functions | | 03 | Aggregation | Summarise data with GROUP BY and HAVING and build pivot-style reports | | 04 | Joins | Combine tables correctly with every kind of join | | 05 | Subqueries and CTEs | Break a hard question into small, readable steps | | 06 | Window functions | Rank, compare rows and build running totals | | 07 | Changing data and design | Insert, update and delete safely, and design good tables | | 08 | Performance and analytics | Read a query plan, index well and write cohort analyses | | 09 | Projects and interviews | Finish two portfolio projects and prepare for interviews |
## What every lesson gives you
- **Notes** that explain the idea in plain language first, then show the SQL.
- **Queries you run yourself.** Type them rather than paste them; typing is how the syntax sticks.
- **Exercises** at the end, with worked answers underneath. Try each one before you look.
- **A quiz** at the end of each module to check you are ready to move on.
[!TIP] Pick a pace you can keep > Most people finish in one of two ways: about 3 weeks at 2 hours a day, or about 8 weeks at 45 minutes a day. Consistency beats long sessions. A short daily habit of running queries does more than one long weekend.
## Which database?
The course is taught on **PostgreSQL**. It is free, it runs on Windows, macOS and Linux, and it follows the SQL standard closely. Most of what you learn works unchanged in MySQL and SQL Server. Where the syntax differs, a note like this one tells you:
