DACKER interview question

Make some joins and window functions in sql