DRW Interview Question

SQL Questions about joins and looping and window functions.