SQL formatting

In the cell controls in the right-hand sidebar, you'll see an option to Format SQL. This will indent and add appropriate spacing to your query, based on the dialect of SQL for your database. (It won't edit capitalization.)