You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers SQL JOIN operations for the OCR A-Level Computer Science (H446) specification. JOINs allow you to combine data from multiple tables based on related columns, which is essential for working with normalised relational databases.
In a normalised database, data is split across multiple tables. JOINs allow you to combine related data from different tables in a single query.
Example tables:
Students:
| StudentID | Name | Age |
|---|---|---|
| 1 | Alice | 17 |
| 2 | Bob | 18 |
| 3 | Charlie | 17 |
Enrolments:
| StudentID | SubjectID |
|---|---|
| 1 | CS |
| 1 | Maths |
| 2 | CS |
Subjects:
| SubjectID | SubjectName | TeacherName |
|---|---|---|
| CS | Computer Science | Dr Smith |
| Maths | Mathematics | Ms Patel |
| English | English Literature | Mr Brown |
An INNER JOIN returns only the rows where there is a match in both tables. Rows without a match in either table are excluded.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.