Pergunta de entrevista da empresa TikTok

Given 4 SQL table, get results with basic join / window function