Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Link table
Message
 
 
To
08/10/2009 10:01:34
General information
Forum:
Microsoft SQL Server
Category:
Database design
Title:
Miscellaneous
Thread ID:
01428259
Message ID:
01428264
Views:
48
>I have two tables called Menus and Menus_Item.
>
>I have allways join both tables by using PK from menus and storinging it in a FK field on the Menus_item.
>But I was looking at somebody else database desing and he was using a link table to join both tables.
>
>The link table name is Menus_Menus_item_link.
>This table has a field for storing the PK of the Menus table and a field for storing PK of Menus_Item table.
>
>Question : Is this a better database desing ?. What are the benefits of having a link table?
>I have never used link tables and I am a little bit confused.
>
>Thanks

Yes, link table or also called junction table is the good way of matching M:M.

So, if it's possible that you may want to have the same Menus and the same Menu Items in different menus (Say, Save in File menu and Save in Table menu - just a sample), then link / junction table is the way to go.

See also http://en.wikipedia.org/wiki/Junction_table
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform