Because the two keys together are the main focus and the primary identifiers of each record in OrderDetails. Any other fields in OrderDetails are directly related to these two keys together, which is why it's a primary key since nothing else can really be
used to identify it. The concepts of primary and foreign keys don't always relate to where the ID comes from as much as the normalization factors involved in the design.
Don't forget to mark useful responses as Answer if they helped you towards a solution.
Anil Srivast...
Member
442 Points
292 Posts
Northwind
Feb 02, 2013 02:34 AM|LINK
Hi
why Order Details table of northwind database has two primary keys(OrderID, ProductID)
which i think both should be foreign key Table(OrderID Orders ),Table(ProductID Products )
markfitzme
Star
14323 Points
2217 Posts
Re: Northwind
Feb 02, 2013 02:39 AM|LINK
Because the two keys together are the main focus and the primary identifiers of each record in OrderDetails. Any other fields in OrderDetails are directly related to these two keys together, which is why it's a primary key since nothing else can really be used to identify it. The concepts of primary and foreign keys don't always relate to where the ID comes from as much as the normalization factors involved in the design.
Anil Srivast...
Member
442 Points
292 Posts
Re: Northwind
Feb 02, 2013 02:49 AM|LINK
one related issue
1) why ms alsays uses this database
2) whether it follows 3nf/4nf/ or bcnf