"Top 3 earners in each department" is harder than it looks, because LIMIT applies to the whole result, not to each group. The standard answer numbers rows inside each group with a window function and keeps those numbered up to N. Use ROW_NUMBER for exactly N rows or DENSE_RANK to include ties. Selecting name with MAX(salary) and GROUP BY is the classic wrong answer.