RBC interview question

SQL join