Clairvoyant interview question

Some SQL queries.