Many-to-Many Relationships

After identifying all the one-to-many relationships in the bookbiz database and associating them with primary key/foreign key pairings, the next step is to consider other kinds of data relationships. For example, how are authors and books related?

Some books are written by more than one author, and some authors have written more than one book. In other words, authors and books have a many-to-many relationship (often written as N-to-N, or N:N, and sometimes called an association). According to entity-relationship theory, associations in relational databases should be represented as tables of their own. In other words, the bookbiz database needs a table for authors, a table for titles, and a table to represent the association ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.