Emacs does not come anything useful for sql indenting. The best thing out there is [sql-indent.el][1] Which doesn't do auto-indenting only on command indentation. [I have found it pretty useful at times][2] [1]: https://github.com/bsvingen/sql-indent [2]: https://stackoverflow.com/a/24659949/1191643