Format SQL with readable clauses, indentation, and nested subqueries.
SQL tokens are re-emitted around SELECT, FROM, JOIN, WHERE, grouping, and nested queries while strings and comments remain intact. Layout changes do not alter query semantics.
select u.name, o.total from users u inner join orders o on u.id = o.user_id where o.total > 100 order by o.total desc limit 10
SELECT u . name, o . total FROM users u INNER JOIN orders o ON u . id = o . user_id WHERE o . total > 100 ORDER BY o . total DESC LIMIT 10
Code reviews, readable migrations, and notebook queries format SQL.