CompTIA DataSys+ (DS0-001)Database FundamentalsMedium

A database architect is designing a schema for a new online library system. The system needs to store information about `Books` and `Authors`. Each book can have multiple authors, and each author can write multiple books. Which type of relationship is described between `Books` and `Authors`?

  1. AOne-to-Many
  2. BMany-to-Many
  3. CMany-to-One
  4. DOne-to-One
Show answer & explanation

Correct answer: B. Many-to-Many

A Many-to-Many relationship exists when one record in table A can be associated with multiple records in table B, and one record in table B can also be associated with multiple records in table A. In this case, one book can have many authors, and one author can write many books.

Why the other options are wrong

  • A. One-to-Many means one record in table A relates to multiple records in table B.
  • C. Many-to-One is the inverse of One-to-Many, where multiple records in table A relate to one record in table B.
  • D. One-to-One means one record in table A relates to exactly one record in table B.

Many-to-Many Relationship

A type of relationship between two entities (tables) where one instance of entity A can be linked to many instances of entity B, and vice-versa.

  • Requires an intermediary (junction/associative) table to resolve in a relational database.
  • Each record in table A can have multiple matching records in table B.
  • Each record in table B can have multiple matching records in table A.

Memory trick: Relationships define how tables talk to each other.

More Database Fundamentals questions