Added doc blocks and split long SQL statements into multiple lines to improve readability