Back to track
Backend Engineer
SQL challenges
10 interview-style coding challenges, with tests and explained solutions.
- 01Second highest salaryEasysubqueriesaggregatesNULL
- 02Duplicate emailsEasyGROUP BYHAVING
- 03Customers who never orderEasyanti-joinNOT EXISTSNULL
- 04Employees earning more than their managersEasyself join
- 05Highest salary in each departmentMediumwindow functionsRANKJOIN
- 06Latest order per customerMediumgreatest-n-per-groupROW_NUMBERDISTINCT ON
- 07Running total of daily revenueMediumwindow functionsSUM OVERwindow frames
- 08Month-over-month revenue growthMediumCTELAGDATE_TRUNC
- 09Top three salaries in each departmentHardwindow functionsDENSE_RANKtop-n-per-group
- 10Longest login streakHardgaps and islandsROW_NUMBERdates