FormattersLesson 10Free preview
SQL Formatter
This lesson is part of Web Developer Tools · All levels
Summary
SQL Formatter arranges queries so that clauses such as SELECT, FROM, WHERE, and ORDER BY are on a readable line. SQL keywords are usually capitalized, while table and column names are left as they are. Subqueries can be indented so that their logical hierarchy is visible. The formatter just changes the view, doesn't run the query and doesn't validate whether the table actually exists.
Key points
- Break down the long query into rows per main clause
- SQL keywords are generally converted to capital letters
- Subquery and JOIN are indented to make it easy to track
- It doesn't change the query results because it's just sorting the text.
- String values and identifier names are retained
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.