Many-to-Many

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Jeroen Oosterlaar
Forum Commoner
Posts: 37
Joined: Sun Nov 06, 2005 4:12 pm

Post by Jeroen Oosterlaar »

In case of a many-to-many relationship, always use a 'connector'-table. Following your authors and books example, the following design can be suggested:

Code: Select all

Author { _autId_, autName, ... };

Book { _booId_, booTitle, ... };

AuthorBookRule { _autId_, _booId_ };
The AuthorBookRule-table describes single author/book relationships, where an author can have one or more books and a book can have one or more authors.
Post Reply