KPMG interview question

Asked me to write SQL query for multiple scenarios.