Composite_PK_Attribute_Order - Database Systems: Design,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Database Systems: Design, Implementation and Management, Rob/Coronel Composite Primary Key Attribute Order 1 Q&A Question: The following question was received from an adopter of the 5 th edition: In reading the text I noticed something that puzzled me. On page 381, the weak entity "ORDER_ITEM" has the key listed as "OI_LINE" & "ORD_ID" in that order and where "ORD_ID" is the foreign key to "ORDER". My question is this: Is the order of the key fields important in relational databases? I may be stuck back in file structures where I would have always put the "ORD_ID" portion of the key first thus enabling direct key reads from the "ORDER" table to the "ORDER_ITEM" table. Is this issue solved by indexes in relational tables? Answer: To see if the order of a composite PK’s attributes matters, let’s examine a simple order entry system in which we have two entities: ORDER and ORDER_ITEM. The ORDER entity has ORD_ID as its PK, while the ORDER_ITEM has a composite PK composed of the combination of the ORD_ID and OI_LINE. (The OI_LINE values are the ORDER_ITEM entity’s line numbers.) Table 1 shows two versions of the ORDER_ITEM entity’s composite PK. Both versions illustrate the same three order
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/10/2011 for the course CIS339 NONE taught by Professor None during the Spring '10 term at DeVry Chicago.

Page1 / 2

Composite_PK_Attribute_Order - Database Systems: Design,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online