SQL Query changes

all query functions now have switch state functionality so that the
importing script doesn’t have to import the classes found in
sql_declarative.
Update of SQL functions

1. get table doesn’t return ‘None’ values
2. get table now requires key string as input