Altered SQL queries