FastPrepStudents and Instructors for Database Systems
Problem · Database

Students and Instructors for Database Systems

EasyKickdrum logoKickdrumINTERNFULLTIMEOA

Problem statement

You are given four relational tables describing students, their course enrollments, courses, and instructors.

Return the name of every student enrolled in a course whose name is exactly Database Systems, together with that course's instructor name.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

students

ColumnTypeNullableDescription
student_idPKIntegerNo
student_nameTextNo

enrollments

ColumnTypeNullableDescription
enrollment_idPKIntegerNo
student_idIntegerNo
course_idIntegerNo

courses

ColumnTypeNullableDescription
course_idPKIntegerNo
course_nameTextNo
instructor_idIntegerNo

instructors

ColumnTypeNullableDescription
instructor_idPKIntegerNo
instructor_nameTextNo

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
student_nameTextNo
instructor_nameTextNo

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • Each table's declared primary key is unique and non-null.
  • Every enrollment references an existing student and course, and every course references an existing instructor.
  • The course-name comparison is case-sensitive and must equal Database Systems.
  • Return one row per matching enrollment, ordered by student_name ascending and then instructor_name ascending.
  • Within enrollment, enrollment_id is the only uniqueness constraint; multiple rows may share the same student and course, and each matching enrollment produces one output row.

More Kickdrum problems