PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates proficiency with relational aggregation and join operations for counting related records across tables. It is commonly asked to assess understanding of SQL joins and grouping within the Data Manipulation (SQL/Python) domain and tests practical application of handling absent relationships rather than purely conceptual theory.

  • Medium
  • Point72
  • Data Manipulation (SQL/Python)
  • Data Scientist

List Departments with Student Counts Including Zero

Company: Point72

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Students +----+--------+---------+ | id | name | dept_id | +----+--------+---------+ | 1 | Alice | 1 | | 2 | Bob | 2 | | 3 | Carol | 1 | +----+--------+---------+ ​ Departments +----+------------+ | id | dept_name | +----+------------+ | 1 | CS | | 2 | Math | | 3 | Physics | +----+------------+ ##### Scenario University dashboard must display every department and how many students it currently has, including departments with zero students. ##### Question Write a SQL query that lists each department name and the corresponding student count. Departments with no students should appear with count = 0. ##### Hints LEFT JOIN Departments to Students, then GROUP BY department ID or name.

Quick Answer: This question evaluates proficiency with relational aggregation and join operations for counting related records across tables. It is commonly asked to assess understanding of SQL joins and grouping within the Data Manipulation (SQL/Python) domain and tests practical application of handling absent relationships rather than purely conceptual theory.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Build the auction status table - Point72 (hard)
  • Write SQL for top student per department - Point72 (Medium)
  • Convert integer dates to quarters - Point72 (Medium)
  • Write SQL for recent customer activity - Point72 (Medium)
  • Convert Dates to Calendar Quarter Labels in SQL/Python - Point72 (Medium)