Cheat SheetsFree downloadPDF (2 pages, A4)
SQL Cheat Sheet for Analysts
A two-page printable SQL reference for analysts: the query structure, joins, CASE, window functions, CTEs, duplicates and dates, plus the credit-risk patterns used in loan reporting (PAR and roll rates).
Who it is for
Analysts, students and finance or operations staff who write SQL for reports and want the everyday patterns in one place.
The problem it solves
SQL is easy to forget between projects, and examples online rarely cover the finance patterns you actually need, such as overdue buckets and roll rates.
What is inside
- The order a query is written in, and the order the database reads it
- Joins, NULL handling and cleaning, with the common mistakes flagged
- Window functions (ROW_NUMBER, RANK, LAG, LEAD, running totals) and CTEs
- Date functions side by side for PostgreSQL, SQL Server and MySQL
- Credit-risk patterns: DPD buckets, portfolio at risk and a roll-rate query
How to use it
- Download the PDF and print it on A4, or keep it open next to your SQL editor.
- Start with sections 1 to 6 for everyday queries.
- Use sections 9 to 12 when you need window functions or loan-portfolio reporting.