KPMG Interview Question

SQL question (but I don't remember question exactly)