Goldman Sachs Interview Question

3SQL + 1 easy coding