Joining Students, Programs, Departments, Courses, Sections, Terms, and Instructors

Overview

In education administration, data is stored across multiple tables. To analyze relationships between students, programs, courses, and instructors, we use JOIN statements to combine tables.

Joins allow you to connect data using shared keys such as student_id, program_id, course_id, section_id, and instructor_id. This helps answer questions that involve multiple parts of the academic system.

Common uses of joins include:• Linking students to their programs• Connecting courses to departments• Combining sections with terms• Associating instructors with course sections• Viewing student enrollments alongside course details

The most common type is the INNER JOIN, which returns only matching records from both tables.


The Basic Pattern


SELECT t1.column1, t2.column2
FROM table1 t1
JOIN table2 t2
ON t1.common_field = t2.common_field;
  

Examples

Example 1 — Join Students with Programs

Example 2 — Join Courses with Departments

Example 3 — Join Sections with Terms


Practice Tasks (Your Turn!)

Task 1

Join instructors with departments to show instructor names and department names.

Task 2

Join enrollments with sections to show student IDs and section numbers.

Task 3

Join sections with courses to show section numbers and course names.

SQL Practice Lab: Joining Students, Programs, Departments, Courses, Sections, Terms, and Instructors
Select a Task
Click a task from Practice Tasks to begin.
Results will appear here…