updated SQL qu for new database; + hs SQL query