Capital One interview question

SQL questions based on a scenario