Updated SQL queries.