Validated examples. Real outputs. Four SQL engines.
Describe the job in plain English. Open the matching SQL with tested syntax, engine notes, and expected result sets already laid out.
Start here
Start from the tasks people actually reach for, then drill into engine-specific examples.
Reference values from preceding or following rows within an ordered partition without writing a self-join.
Extend a table's structure by adding a new column with `ALTER TABLE`.
Calculate a future or past date by adding or subtracting an interval from an existing date.
Use `CASE WHEN` inside `SUM` or `COUNT` to produce multiple metrics from a single pass over grouped data.
Collect values from multiple rows into a single JSON array, ordered and grouped by other columns.