31_Relationships.pdf - CITS1402 Relational Database...

This preview shows page 1 - 10 out of 14 pages.

CITS1402 Relational Database Management Systems Video 31 — Relationships Gordon Royle Department of Mathematics & Statistics
Relationships This video goes into more detail about relationships , I Types of relationship I Relationships in an ERD I Relationships in SQL
What is a relationship?
Background image
The relation The relation can be given just as a list of pairs (1,'CITS1402') (1,'CITS1401') (1,'MATH1001') (2,'CITS1402') (2,'CITS1401') We’ve already seen that in an RDBMS, we store a relation as a table with two columns, each of which is a foreign key.
Examples from Chinook
Types of relationship In the Enrolment relation: I One Student can enrol in multiple Unit s I One Unit can have multiple Student s enrolled (1,'CITS1402') (1,'CITS1401') (1,'MATH1001') (2,'CITS1402') (2,'CITS1401') This is called a many-to-many relation.
In the ERD A many-to-many relation in the ERD is implemented as a table in the database.
Types of relationship In the isOn relation: I One Track is on exactly one Album I One Album can have multiple Track s .

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture