{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter 5 Notes

Chapter 5 Notes - Chapter 5(Watson Many-to-many...

Info icon This 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
Image of page 1

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

View Full Document Right 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
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern