How to format SQL
- Paste your query. Several statements separated by semicolons are fine.
- Pick your database’s dialect and how keywords should look.
- Choose Format for readable SQL, or Minify to put it on one line.
Why format SQL?
- Each clause (
SELECT,FROM,WHERE,JOIN) on its own line makes long queries easy to read and review. - Consistent formatting keeps diffs in code review small and clear.