SQL Formatting Algorithm
- Start with unformatted SQL code
- Place newline reserved words in a set
- Place all reserved words in a set
- Divide up the unformatted SQL code into a list of words
- If the word is select, increment the select counter and print out select
- If the word is not select, then print the word like normal in the same line
- Check the word for a comma.
- If there is a comma, check if the comma is in the beginning or the end. Split the line by the comma so that the first line ends with the comma and the new line starts at the first character after the comma.