SQL - Ludicrous 4

The goal of this quest series is to improve your SQL skills
Goals
- Improve your SQL skills
Codewars Katas
You need to resolve this two Codewars Katas
↗
SQL Tuning: Function Calls
codewars.com
↗
Using Window Functions To Get Top N per Group
codewars.com
Challenge
Codewars Katas
Once you have completed the katas, you can validate this quest yourself.