Dubizzle Interview Question

CTE, Window Functions in SQL