Added SQL to configuration

Moved all the SQL to the configuration file so that it can be easily
modified.