What advantages do we have when creating a separate mapping table for two relational tables

Posted by Pankaj Upadhyay on Programmers See other posts from Programmers or by Pankaj Upadhyay
Published on 2011-11-13T11:22:49Z Indexed on 2011/11/13 18:05 UTC
Read the original article Hit count: 307

In various open source CMS, I have noticed that there is a separate table for mapping two relational tables. Like for categories and products, there is a separate product_category_mapping table. This table just has a primary key and two foreign keys from the categories and product tables.

My question is what are the benefits of this database design rather than just linking the tables directly by defining a foreign key in either table? Is it just matter of convenience?

© Programmers or respective owner

Related posts about database-design

Related posts about database-development