Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Rank Branch Placements by Month

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Rank Branch Placements by Month. Start with the requirements and the two tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

How would you write a query to find branches that placed more than 100 candidates this month and rank them by total placements?

Use the provided branch and placement data. Consider only placements dated in the current calendar month.

Output

  1. One row per qualifying branch with branch_name, candidates_placed, total_placements, and placement_rank.
  2. Include only branches with more than 100 candidates placed.
  3. Order by total_placements descending, then branch_name ascending to break ties.

Schema

branches
ColumnTypeDescription
branch_idPKINTUnique branch identifier
branch_nameVARCHAR(100)Name of the recruitment branch
cityVARCHAR(100)City where the branch operates
placements
ColumnTypeDescription
placement_idPKINTUnique placement batch identifier
branch_idINTBranch responsible for the placements
placement_dateDATEDate on which the placement batch was recorded
candidates_placedINTNumber of candidates placed in the batch
placement_countINTNumber of placement transactions in the batch
Tablesbranchesplacements
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results