Forgly

SQL query examples

Ready-to-copy SQL for the queries developers look up most — each with the code across PostgreSQL, MySQL, SQL Server, and SQLite, plus a plain-English explanation of how it works.

Need a query for your own schema? Describe it in plain English with the AI SQL Generator →

Ranking & top-N

Grouping & aggregation

Finding & removing duplicates

Joins & set operations

Dates & time

Modifying data