Some SQL queries for DBA's everyday  job