Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Using SQL for Student Data
00:00
5 left

Using SQL for Student Data

MediumSQL · PostgreSQL

Problem

How would you use SQL to analyze student performance data at KIPP Schools?

Using the provided tables, write a query that summarizes scored assessments by school and subject for the 2024-2025 academic year. Exclude subjects with fewer than two non-null scores and assign each remaining subject a performance rank within its school.

Output

  1. One row per school and subject that meets the minimum score requirement
  2. Columns: school_name, subject, average_score, assessment_count, and subject_rank
  3. Sort by school name, rank ascending, and subject alphabetically

Schema

students
ColumnTypeDescription
student_idPKINTUnique student identifier
first_nameVARCHAR(50)Student first name
last_nameVARCHAR(50)Student last name
school_nameVARCHAR(100)KIPP school attended by the student
grade_levelINTStudent grade level
assessments
ColumnTypeDescription
assessment_idPKINTUnique assessment identifier
subjectVARCHAR(50)Assessment subject
academic_yearVARCHAR(20)Academic year of the assessment
assessment_scores
ColumnTypeDescription
score_idPKINTUnique score record identifier
student_idINTStudent receiving the score
assessment_idINTAssessment associated with the score
scoreDECIMAL(5,2)Assessment score, which may be missing
Tablesstudentsassessmentsassessment_scores
Interviewer

Your question is Using SQL for Student Data. Start with the requirements and the three tables in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.