FindPrompts
Sign InGet Started

Get the best new prompts every week

Join the FindPrompts newsletter — top prompts, fresh mastery guides, and AI workflow tips. Free, no spam.

FindPrompts

The largest AI prompts database. 30,000+ prompts for ChatGPT, Claude, Midjourney, and more.

Categories

  • Marketing
  • Business
  • Writing
  • Coding
  • Education

Platforms

  • ChatGPT
  • Claude
  • Gemini
  • Grok
  • Midjourney

Resources

  • Best AI Prompts
  • Free Tools
  • Prompt Grader
  • Prompt Templatizer
  • AI Token Counter
  • Image Prompt Generator
  • System Prompt Generator
  • Prompt A/B Tester
  • Prompt-to-JSON
  • Headline Generator
  • AI Cost Calculator
  • AI Prompt Improver
  • Prompt Generators
  • Mastery Guides
  • Cheatsheets
  • Automations
  • AI Tools
  • Custom GPTs
  • Blog
  • Affiliate Program

Company

  • Pricing
  • Contact
  • Terms of Service
  • Privacy Policy

© 2026 FindPrompts. All rights reserved.

TwitterGitHub
FindPrompts
FindPrompts

Main

Dashboard
Prompt Library30k+
DiscoverHot
LeaderboardNew
BundlesNew
Prompt Maker
PlaygroundBeta
GeneratorsNew
WorkflowsPro

Personal

Compare
Prompt Improver
Prompt Grader
Templatizer
Token Counter
Image Prompts
System Prompts
A/B Tester
All Free Tools
My Vault
Analytics
Submit Prompt
AI Tools
Guides
Cheatsheets
Automations
Settings
Go Pro

Unlock workflows, API access, and premium features.

Upgrade Now

User

Command Palette

Search for a command to run...

HomeCheatsheetsSQL Quick Reference Cheatsheet
Coding5 min

SQL Quick Reference Cheatsheet

A compact SQL reference covering the clauses, joins, and functions you reach for daily. Standard ANSI SQL syntax that works across Postgres, MySQL, and SQLite.

Querying Basics

SELECTSELECT col1, col2 FROM table; use * for all columns.
WHEREFilter rows: WHERE price > 100 AND in_stock = true.
ORDER BYSort: ORDER BY created_at DESC, name ASC.
LIMIT / OFFSETLIMIT 10 OFFSET 20 for pagination.
DISTINCTSELECT DISTINCT country removes duplicate rows.
ASAlias columns or tables: SELECT total AS revenue.

Filtering Operators

INWHERE status IN ('open', 'pending')
BETWEENWHERE age BETWEEN 18 AND 65 (inclusive).
LIKEWHERE name LIKE 'A%' matches names starting with A.
IS NULLWHERE deleted_at IS NULL (use IS, not =).
COALESCECOALESCE(nickname, name) returns the first non-null value.

Joins

INNER JOINRows with matches in both tables.
LEFT JOINAll left rows; nulls where the right has no match.
RIGHT JOINAll right rows; nulls where the left has no match.
FULL OUTER JOINAll rows from both sides, matched where possible.
ONJoin condition: ON orders.user_id = users.id
Self joinJoin a table to itself with two aliases (e.g. e and m).

Aggregation

COUNT / SUM / AVGAggregate functions: COUNT(*), SUM(amount), AVG(score).
MIN / MAXSmallest and largest values in a column.
GROUP BYAggregate per group: GROUP BY category.
HAVINGFilter groups after aggregation: HAVING COUNT(*) > 5.
Window functionsROW_NUMBER() OVER (PARTITION BY x ORDER BY y) for ranked rows.

Modifying Data

INSERTINSERT INTO t (a, b) VALUES (1, 2);
UPDATEUPDATE t SET status = 'done' WHERE id = 5;
DELETEDELETE FROM t WHERE id = 5; (always include WHERE).
UPSERTINSERT ... ON CONFLICT (id) DO UPDATE SET ... (Postgres).
TransactionsBEGIN; ...; COMMIT; or ROLLBACK; to undo.

Related Cheatsheets

Regex Cheatsheet

Common regular expression syntax and ready-to-use patterns.

Git Commands Cheatsheet

Everyday git commands for branching, committing, and fixing mistakes.

Want ready-to-use prompts to go with this cheatsheet?

Browse 30,000+ Prompts