module 3 of 8 · 45 min

SQL

Query relational data accurately and reason about joins, grouping and performance.

Explain SQL clearlyImplement a small SQL exampleEvaluate whether SQL improves a simpler baselineIdentify failure cases and operational constraints
learning statenot started
0% completesign in to track progress
mental model

start with the idea before the implementation.

SQL describes the result you want while the database chooses an execution plan.
core concepts

the mechanisms you need to reason about.

01

Joins and cardinality

Joins and cardinality is studied through intuition implementation evidence and trade-offs. The goal is to be able to explain the mechanism and verify it with a concrete test rather than only repeat a definition.

02

Aggregations

Aggregations is studied through intuition implementation evidence and trade-offs. The goal is to be able to explain the mechanism and verify it with a concrete test rather than only repeat a definition.

03

Window functions

Window functions is studied through intuition implementation evidence and trade-offs. The goal is to be able to explain the mechanism and verify it with a concrete test rather than only repeat a definition.

04

Indexes and query plans

Indexes and query plans is studied through intuition implementation evidence and trade-offs. The goal is to be able to explain the mechanism and verify it with a concrete test rather than only repeat a definition.

engineering lab

turn the lesson into evidence.

LAB 1

design three analytical queries

Build the smallest version first. Record the input, expected output, measured result and one failure you discovered.

LAB 2

compare join strategies

Build the smallest version first. Record the input, expected output, measured result and one failure you discovered.

LAB 3

inspect an execution plan

Build the smallest version first. Record the input, expected output, measured result and one failure you discovered.

knowledge checks

prove you can explain and decide.

1

avoid accidental row multiplication

ask cortex to test me →
2

explain GROUP BY vs window functions

ask cortex to test me →
3

identify an index candidate

ask cortex to test me →
failure modes

what usually goes wrong.

risk

SELECT * everywhere

Detect this early by defining a baseline, a measurable signal and a condition that would cause you to stop or redesign the approach.

risk

missing join conditions

Detect this early by defining a baseline, a measurable signal and a condition that would cause you to stop or redesign the approach.

risk

filtering after an expensive expansion

Detect this early by defining a baseline, a measurable signal and a condition that would cause you to stop or redesign the approach.

proof of learning

Create a short SQL engineering note with one working artifact one metric one failure case and one decision about when you would or would not use it.

Save the result in your portfolio or project repository. A strong learning artifact should make your assumptions, metrics and failure analysis visible.