SQL window functions practice: shares, running totals, growth and ranks
SQL · Lesson 9
Ctrl/⌘ + Enter to run
✓
SQL Lesson 9 done.
Those nine queries are most of what a sales or finance report asks of SQL: a share of the total, a gap to the best, a running total on top of GROUP BY, a year-to-date figure that restarts in January, growth against the month before, a moving average that doesn't pretend to have three months when it has one, tiers with NTILE, the frame that LAST_VALUE needs, and a ranking that keeps ties. Next: ten interview questions that mix these with joins, CASE and recursion.
More SQL practice
SQL practice onlineSQL skills testSQL SELECT practiceSQL GROUP BY practiceSQL JOIN practice exercisesSQL subquery practicePrimary and foreign key practiceDatabase normalization practiceSQL constraints practiceSQL views practiceSQL interview practiceSQL reference with queries you can runSQL errors, with a query to fixSQL interview questions, with answersSQL sample database for practiceExcel practice onlineLearn to read financial statements