Update SQL queries for admin/* to reflect new database structure.