Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top N Records Per Group in SQL

Medium
SQL & Data ManipulationWindow FunctionsRankingGroup By

Problem

How would you write a SQL query to find the top N records in each group?

Practicing as: Data Analyst interview at WNS

Hi, I'll play your WNS interviewer for the Data Analyst role. Candidates describe these interviews as mixed and moderately difficult, so expect me to be professional and fair. Take your time with the question above and answer like we're in the room.

You are practicing as a guest. Sign up free to get your answer graded with AI feedback. Your draft stays right here.

Sign up freeI have an account
Sign up to unlock solutions
Next questions
IdexcelTop N Records Per GroupHardWalgreens Boots AllianceTop N Records Per GroupMediumBlackRockTop N Per Group SQLMedium