This page provides a way to format SQL in Emacs. BackendSqlBeautify is a shell utility which uses blancoSqlFormatter as a backend. See SqlBeautify(https://github.com/ldeck/SqlBeautify) on github. Note: It seems like the underlying ant script for the repo above is broken. An alternative is to install a ruby gem called anbt-sql-formatter. You can run the following command to install the cli tool: ge