Clairvoyant Interview Question

Some SQL queries.