Updated SQL queries for auto-testing.