DB Quacks SQL Tutorial · Chapter 5

WITH Great Power: The CTE Symphony

Maestro duck appears with a conductors baton. Welcome to Query Symphony Orchestra! Complex analysis needs multiple movements working harmoniously. First find ducks older than 3, then show only frequent pond visitors (ducks who visited ponds more than 2 times). Use CTEs!

Your task

Create a multi-step analysis using CTEs - first find older ducks from the ducks table, then filter by visit frequency from 'data/pond_visits.csv'. You will be using Common Table Expressions to break down complex logic.

Start level 27 →

DuckDB docs for this lesson