Relational databases store data across multiple tables, which improves organisation and reduces duplication. To retrieve meaningful information from these tables, SQL joins are used. In IB Computer Science, students are expected to understand what joins are, why they are needed, and how they conceptually combine data.
IB examiners focus on understanding relationships, not memorising complex syntax.
Why Joins Are Needed
When databases are normalised:
- Related data is split across tables
- Each table stores one type of information
- Tables are linked using keys
For example:
- One table stores student details
- Another table stores enrolment information
A join allows data from these tables to be viewed together in a single result.
Without joins, users would need to:
- Run multiple queries
- Manually combine results
Joins make databases powerful and efficient.
What Is a Join?
A join is an SQL operation that:
- Combines rows from two or more tables
- Uses a related field (usually a key)
- Produces a unified result set
Joins rely on:
- Primary keys in one table
- Foreign keys in another table
The join condition defines .
