Bright Computing interview question

SQL queries for different requirements