Temporarily copied sql files to rh folder

Temporarily copied some SQL files to RH folder, also made a small
change to queryTable function in sql_declarative