Standardize SQL queries.

I standardized the SQL queries and adding them to the top of the classes for better visibility.