News

🖊️ SQL Query Editor

Write, format, and export SQL queries with one-click prettification.

SQL Input 13 lines · 268 chars
Batch Format — Multiple Queries
👑
Pro Feature
Batch SQL formatter is available on the Pro plan.

About the SQL Query Editor

The SQL Query Editor is a browser-based editor for writing, formatting, and exporting SQL queries. It formats raw or minified SQL into clean, readable output with proper keyword casing and clause indentation — useful for reviewing AI-generated SQL, documenting queries, or preparing code for review.

How to use this tool

  • Paste or type your SQL query in the SQL Input area.
  • Click Format SQL to prettify the query: keywords are uppercased, major clauses are placed on new lines, and SELECT columns are each indented on their own line.
  • Click Copy to copy the formatted result to your clipboard.

What the formatter does

  • Keyword uppercasing — SQL keywords such as SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, AND, OR, NULL, and aggregate functions are automatically uppercased.
  • Clause line breaks — each major clause (SELECT, FROM, JOIN variants, WHERE, GROUP BY, ORDER BY, HAVING, LIMIT) is placed on its own line.
  • SELECT column indentation — each selected column is placed on a separate indented line for readability.
  • WHERE condition indentationAND and OR conditions are indented to align under the WHERE clause.

SQL clause reference

  • SELECT — specifies the columns to return. Use * for all columns or list specific columns. Aggregate functions (COUNT, SUM, AVG, MIN, MAX) summarise data across rows.
  • FROM — identifies the table(s) to query. Table aliases (e.g., users u) shorten references.
  • JOIN — combines rows from two tables. INNER JOIN returns only matching rows; LEFT JOIN returns all rows from the left table even if there is no match.
  • WHERE — filters rows before grouping. Use AND / OR to combine conditions.
  • GROUP BY — groups rows sharing the same value in specified columns, enabling aggregate functions.
  • HAVING — filters groups after aggregation (like WHERE but for grouped results).
  • ORDER BY — sorts the result set. Add ASC (default) or DESC per column.
  • LIMIT / OFFSET — restricts the number of rows returned; useful for pagination.