Capital One interview question

SQL queries were asked Case study