SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 FKs in one table to multiple tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 08/30/2012 :  10:53:38  Show Profile  Reply with Quote
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?


Very Important crosS Applying yaK Herder

52326 Posts

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

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000