What does a SQL formatter do?
SQL is easy to write on one line and hard to read there. A formatter puts each clause on its own line, indents the columns and conditions and gives keywords a consistent case, so the structure of the query is visible.
The tool reads the query with the rules of the dialect you choose, because databases differ in quoting, functions and keywords. The sample query, about 195 characters on one line, becomes lines for SELECT, FROM with the LEFT JOIN, WHERE, GROUP BY, HAVING, ORDER BY and LIMIT.
How to use the SQL Formatter
- Paste your SQL on the left.
- Choose your dialect, such as PostgreSQL or MySQL.
- Choose keyword case and the indent.
- Copy or download the formatted query.