Chapter 5 Notes

Chapter 5 Notes - February 26, 2008 Chapter 5 (Watson)...

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

View Full Document Right Arrow Icon
February 26, 2008 Chapter 5 (Watson) Many-to-many relationship Example: entities SALE & ITEM o A sale can consist of many items o An item can appear in many sales M:M Line suggests a weak entity Has a concatenated key (sale number and line number) “A sale has many line items” “A line item refers to only one sale” “An item can appear as many line items” “A line item references only one item” The second setup runs faster (less CPU time) How is this done in Oracle? Use saleno and lineno as a PK of LINEITEM (called an ASSOCIATIVE entity) Difference between base tables and derived tables o Say you are working for Pine Valley Furniture. You are their DBA. They will come in with an off-the-shelf vendor with software. You must support it. It is installed and then trained the people that are going to use it. SALE ITEM SALE Line Item ITEM CREATE TABLE sale (saleno integer NOT NULL, …, PRIMARY KEY(saleno)); CREATE TABLE item (itemno integer NOT NULL, …, PRIMARY KEY(itemno)); CREATE TABLE lineitem (lineno integer NOT NULL, Primary key(lineno, saleno), Foreign key fksale(saleno) references sale on delete restrict, Foreign key (itemno) reference item on delete restrict; 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
o As the DBA, you must support it because if there are any issues, they are going to come to you first. You have a bunch of people using it and the file server might not work well. o The base tables are the ones that the came from the vendor o You are stuck with these tables o The tables that you and others start creating are user tables o You may create a derived table when you put two tables together to form a new table (its an add-on from you) that is not included with their software Chapter 7 (Watson) Date Modeling
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/19/2008 for the course SW 402 taught by Professor Coccran during the Spring '08 term at Fairfield.

Page1 / 6

Chapter 5 Notes - February 26, 2008 Chapter 5 (Watson)...

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

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