Capital One interview question

SQL: connect table, group by, having, basics.