SQL Cheatsheet
NewSQL reference — joins, window functions, CTEs, aggregates, and transactions.
Frequently Asked Questions
Does this SQL cheatsheet cover JOINs and window functions, or is it just basic SELECT syntax?
It goes well past basic querying. The entries are grouped into Querying, Joins, Aggregation, CTEs & Subqueries, Window Functions, Data Modification, Schema & Constraints, and Transactions, with cards for things like FULL OUTER JOIN, ROW_NUMBER, LAG/LEAD, recursive CTEs, and savepoints.
What changes when I click Show full syntax?
The cards switch from a compact cue like `SELECT DISTINCT ...` or `ROW_NUMBER() OVER (...)` to the fuller statement template stored in the component. It is useful when you remember the concept but need the full clause shape back in front of you.
Can I copy a full transaction or CTE example from this page?
Yes. Each card has separate Copy syntax and Copy example buttons, so you can grab either the generic pattern or the concrete sample query shown on that card.
Will this run or validate my SQL?
No. This component is a searchable reference grid only; it does not connect to a database, parse your query, or check vendor-specific syntax for you.
If I search for something like NULL or OFFSET, what does it search through?
The search matches across the category, card title, short command, full syntax, description, and example text. That means terms like `COALESCE`, `OFFSET`, `HAVING`, or `NULLIF` can surface cards even if you do not remember the exact category first.