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.
Return a value from the first row of a window partition, useful for comparing each row against the group leader.
Extend a table's structure by adding a new column with `ALTER TABLE`.
Enforce referential integrity by linking a column to the primary key of another table so orphaned rows cannot be inserted.
Calculate a future or past date by adding or subtracting an interval from an existing date.