Bird
0
0

You need to design a database for a library system. Books can have multiple authors, and authors can write multiple books. Which design approach best models this relationship?

hard📝 schema Q8 of 15
SQL - Database Design and Normalization
You need to design a database for a library system. Books can have multiple authors, and authors can write multiple books. Which design approach best models this relationship?
AStore authors as a comma-separated string in books table
BAdd multiple author columns in books table
CCreate three tables: books, authors, and a join table book_authors with foreign keys
DCreate a single table combining books and authors
Step-by-Step Solution
Solution:
  1. Step 1: Identify relationship type

    Books and authors have a many-to-many relationship.
  2. Step 2: Choose correct modeling approach

    Many-to-many requires a join table linking books and authors with foreign keys.
  3. Final Answer:

    Create three tables: books, authors, and a join table book_authors with foreign keys -> Option C
  4. Quick Check:

    Many-to-many modeled with join table [OK]
Quick Trick: Use join tables for many-to-many relationships [OK]
Common Mistakes:
  • Adding multiple author columns instead of join table
  • Storing multiple authors in one string
  • Combining books and authors in one table

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes