This visual execution trace shows how to write a SQL query to get the top N rows per group. The query uses ROW_NUMBER() with PARTITION BY to assign a row number to each row within its group, ordered by a criteria such as salary descending. Then it filters to keep only rows where the row number is less than or equal to N, effectively selecting the top N rows per group. The execution table walks through each row, showing the assigned row number and whether it is included in the output. The variable tracker shows how the row number resets for each group. Key moments clarify why some rows are excluded and how partitioning works. The quiz tests understanding of row numbers and filtering. The snapshot summarizes the syntax and behavior for quick reference.