IBM Interview Question

SQL queries on count and joins