4.3.3 Joining things up

Cards (9)

  • Joining table
    A table that lists every relationship between every entity in a relational database
  • Relationships are stored in a joining table
  • Joining table

    • Each record represents a single relationship between entities
    • Student keys appearing more than once shows an individual student studies many courses
    • Course codes listed multiple times shows the course is being taken by many students
  • Many-to-many relationship
    A relationship where an entity on one side is related to multiple entities on the other side, and vice versa
  • Querying a relational database to find courses taken by a student

    1. Query Student_Table to get student's key
    2. Use student's key to query Student_Allocation_Table to get course codes
    3. Query Course_Table to get course titles
  • The complexity of the database is hidden from the user
  • Entities in the committee meeting database

    • Committee
    • Member
  • Key field

    A field that uniquely identifies each record in a table
  • A joining table is needed to represent the many-to-many relationship between committees and members