TOAD FOR ORACLE
SHIFT+CTRL+F should help you
To format a statement Select the statement you want to select and click »
on the Edit toolbar.
To format an entire script Click »
on the Edit toolbar.
Tip:You can also right-click the script and select Formatting Tools |
Format Code.
See the documentation
TOAD FOR MYSQL
Format SQL
Use the formatter to modify the layout of SQL in the Editor, including inserting headers, adding or removing extra lines, and changing the case for keywords.
To format SQL
Click Paint shaped box
on the Editor toolbar to format the contents of the Editor window. You can also format a partial statement in the Editor by selecting it before applying formatting.
See documentation