Course Content
Day 1 – Foundations
- Relational databases: tables, keys, relationships, normalisation to the depth you need
- Overview of SQL Server Management Studio and Azure Data Studio
- SELECT, WHERE, ORDER BY — the basic structure of every query
- Data types and their pitfalls, handling NULL correctly
- Sorting, restricting, TOP and OFFSET FETCH
- Functions for text, numbers and dates
Day 2 – Joining and Aggregating Data
- JOIN in all its forms: INNER, LEFT, RIGHT, FULL, CROSS
- The most common mistake with OUTER JOIN and WHERE
- Grouping with GROUP BY, filtering with HAVING
- Aggregate functions and how they handle NULL
- Subqueries and correlated subqueries
- Set operators UNION, INTERSECT, EXCEPT
- Common table expressions for readable queries
Day 3 – Advanced Topics and Practice
- Window functions: ROW_NUMBER, RANK, LAG, LEAD, running totals
- PIVOT and UNPIVOT
- CASE expressions and conditional logic
- Inserting, changing and deleting data with INSERT, UPDATE, DELETE and MERGE
- Understanding transactions: why COMMIT and ROLLBACK matter
- Reading execution plans: why a query is slow
- Indexes from a query perspective: what helps and what doesn’t
- Workshop on your own questions