Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Filter Students by Subject and Grade

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

Your question is Filter Students by Subject and Grade. Start with the requirements and the three 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

Adobe Digital Academy tracks student performance across technical subjects. Write a PostgreSQL query that finds students enrolled in Adobe Analytics who earned a grade of at least 85.

Requirements

  1. Join students, grades, and subjects using their key relationships.
  2. Filter for the exact subject name Adobe Analytics and grades greater than or equal to 85.
  3. Return the student ID, student name, subject name, and numeric grade.
  4. Sort results by grade descending, then student name ascending. Rows with no grade must not qualify.

Schema

students
ColumnTypeDescription
student_idPKINTUnique student identifier
student_nameVARCHAR(100)Student's full name
emailVARCHAR(255)Student email address
subjects
ColumnTypeDescription
subject_idPKINTUnique subject identifier
subject_nameVARCHAR(150)Subject title
grades
ColumnTypeDescription
grade_idPKINTUnique grade record identifier
student_idINTReferenced student
subject_idINTReferenced subject
gradeINTNumeric grade from 0 to 100
Tablesstudentssubjectsgrades
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results