RBC Interview Question

Coding a lot of sql queries