INTERMEDIATE · 8 MODULES · 64 LESSONS

Advanced SQL Querying

Answer complex business questions with a single clear, fast SQL query, and stop exporting to spreadsheets what the database can already do for you.

For you if
You already write SELECT, WHERE, and ORDER BY, and anything beyond that feels hard.
By the end
You'll know how to use JOINs, CTEs, and window functions, and read the query plan to speed up a slow query.
You need
Basic SQL and Python 3. The database runs on SQLite, with nothing else to install.
  1. 01Más allá del SELECT básico — consultar de verdad8 LESSONS
    1. Module 1 Introduction: Beyond the Basic SELECT
    2. The query as a question
    3. `WHERE` in depth
    4. `ORDER BY`, `LIMIT`, and `DISTINCT`
    5. Expressions and aliases
    6. `CASE WHEN`
    7. `LIKE` and its traps
    8. Mini-project: answer 5 business questions about Reservo
  2. 02JOINs a fondo — INNER, LEFT, self y multi-tabla8 LESSONS
    1. Module 2 Introduction: JOINs in Depth
    2. `INNER JOIN` and the `ON` clause
    3. `LEFT JOIN` and rows without a match
    4. The anti-join: finding what's missing
    5. The self-join
    6. Joining three or more tables
    7. `ON` vs `WHERE` and the Cartesian product
    8. Mini-project: Reservo questions across tables
  3. 03Agregación — GROUP BY, HAVING y funciones de agregado8 LESSONS
    1. Module 3 — Aggregation: summary questions about Reservo
    2. Aggregate functions and what they do with NULL
    3. COUNT(*), COUNT(column), and COUNT(DISTINCT): three different counts
    4. GROUP BY: collapsing rows into groups (and the golden rule)
    5. Grouping by an expression: bookings per month with strftime
    6. HAVING vs WHERE: filtering rows before, filtering groups after
    7. Aggregating over JOINs: revenue per room (with its name) and the LEFT JOIN trap
    8. Mini-project: Reservo's revenue summary
  4. 04Subconsultas — escalares, IN, EXISTS y correlacionadas8 LESSONS
    1. Module 4 — Subqueries: a question inside another
    2. The scalar subquery
    3. Subqueries in `WHERE` with `IN` and `NOT IN`
    4. `EXISTS` and `NOT EXISTS`
    5. The derived table in the `FROM`
    6. The correlated subquery
    7. Subquery vs JOIN and the `NOT IN` with `NULL` trap
    8. Mini-project: answering Reservo questions with subqueries
  5. 05CTEs — WITH y consultas legibles (incluida la recursiva)8 LESSONS
    1. Module 5 — CTEs: splitting a complex query into named steps
    2. What a CTE is, and why it's about readability
    3. The WITH clause: syntax, scope, and multiple CTEs
    4. Chained CTEs: building the result step by step
    5. CTE vs subquery vs view: when to use each
    6. Recursive CTEs: anchor case, recursive case, and stop condition
    7. The recursive date series: a monthly report with no gaps
    8. Mini-project: rewrite with CTEs and build the gap-free monthly report
  6. 06Window functions — `ROW_NUMBER`, `RANK`, running totals8 LESSONS
    1. Module 6 — Window functions: calculating over a window of rows without collapsing them
    2. The window keeps the detail AND aggregates (unlike `GROUP BY`)
    3. The `OVER` clause: `PARTITION BY` defines the groups, `ORDER BY` the order
    4. `ROW_NUMBER`, `RANK`, and `DENSE_RANK`: three ways to number, and the tie that tells them apart
    5. The running total: `SUM(...) OVER (ORDER BY ...)` = accumulated revenue
    6. `LAG` and `LEAD`: looking at the previous or next row (the month-over-month delta)
    7. Top-N per group: `ROW_NUMBER` + a CTE (because the `WHERE` can't see the window)
    8. Mini-project: Reservo's report rankings and running totals
  7. 07Optimización de consultas — leer el plan y acelerar8 LESSONS
    1. Module 7 — Query optimization: reading the plan and speeding things up
    2. Why a query is slow, and how to read `EXPLAIN QUERY PLAN`
    3. Reading `SCAN` vs `SEARCH`: the index changes one word (and 100× the time)
    4. Indexes for `WHERE`, `JOIN`, and `ORDER BY`
    5. SARGable predicates: when a function on the column kills the index
    6. The N+1 pattern: a hundred queries where one would do
    7. Measuring before and after: choosing with data, not intuition
    8. Mini-project: optimize Reservo's slow queries
  8. 08El capstone — el reporte analítico de Reservo8 LESSONS
    1. Module 8 — Reservo's analytical report: the capstone that weaves the seven modules together
    2. Revenue by room and by month: the dashboard's first gauge
    3. Top members by spend: aggregation with ranking
    4. Accumulated revenue and month-over-month change: the dashboard's odometer
    5. Occupancy by room: the business's fuel level
    6. Refund rate and net revenue: the warning light
    7. The gap-free monthly report: composing with recursive CTEs and windows
    8. Delivering the report and closing out the guide
Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!

SEC. 06 · THE STUDIO

Why this studio exists

For decades, building software belonged to technical profiles with years of training, and getting a digital product into the real world took companies months or years. No-code and AI have narrowed that gap, but the knowledge is still held by a few.

Tech Benders exists to open that knowledge up, so business teams and non-technical teams can put their ideas into production with the right technical decisions behind them. AI does what you ask of it. Without a technical base, what it builds may not scale with your company’s ecosystem, and its costs can run away over time.

The team knows the pains of large organizations and the speed at which they have to move. It brings solution architecture, data engineering, product built end to end from back end to front end, and daily work with AI. Software that solves what you need in days, not months, with the cost of AI kept in check.

Founders

The studioRead about Tech Benders →

Write to ushi@techbenders.io

Made with Wislab