Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 FKs in one table to multiple tables

Author  Topic 

SBRDude
Starting Member

2 Posts

Posted - 2012-08-30 : 10:53:38
Seems like this is a basic thing and that I already understand it, but wanted to make sure.

A quick description of a situation.

An orders table with an orderID column that is the PK
A products table with a productID PK.
An ordersdetail table with FKs to both orders.orderID and products.productID.

Is this the right way to set up the ordersdetail table, with a FK to the order table and the product table?

-Milo

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-30 : 10:57:59
yep...it is so that values in orderdetail corresponds to valid product or order value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -