Download presentation
Presentation is loading. Please wait.
Published byRobert Henry Modified over 9 years ago
1
Relationships II Copyright © 1999 Patrick McDermott UC Berkeley Extension pmcdermott@msn.com Earth’s Interrelated Systems & Climate NASA
2
Optionality Is it Mandatory or Optional ? A Business Rule –But practicalities, too o Is zero a number??? Programmers: 0, 1, Hottentots: 1, 2, Many Analysts: 0, 1, Many
3
Cardinality 1 to 1 1 to Many Many to Many 11 1 ** *
4
Multiplicity 1 to 1 1 to Many Many to Many 0..1 0.. * 1.. 1 1.. * 0.. * O O O
5
Multiples 2 Teacher s, 1 ClassSection 2 Course s, 1 ClassSection Employee with 2 Boss es Choose the main one Define one as ‘first’ –Primary contact Denormal 1, 2 New table
6
Break M2m 1Stick a Box in the Middle “Intersection Table” “Junction table” 2Flip the Asterisks (Arrows) In 3Migrate the Keys 4Find a Name 5See if it’s already there 6 Add attributes of the Junction
7
Order to Product ORDER PRODUCT ORDER PRODUCT ITEM Quantity Price # # # # # # * * * *
8
Teacher to Student TEACHER STUDENT TEACHER STUDENT ENROLLMENT Date Grade * * * *
9
Employee to Department EMPLOYEE DEPARTMENT EMPLOYEE DEPARTMENT ASSIGNMENT Date Hours
10
Complex For simplicity, reclassify a complex relationship as an entity, related through binary relationships to each of the original entities. SalespersonCarCustomer SALE
11
Y 1-2-1? 1.Faster queries if often need a few 2.Isolate null, unknown values 3.Ez2 restrict access 4.Separate BLOBs StuffMore Stuff 1 1
12
BOM Bill-Of-Materials –A Part is made up of Part s –Manufactures –Hamburger A BOM Explodes and Implodes Be careful if traveling! –“Explode the BOM” could get you in trouble –If you see your friend Jack, don’t say “Hi” Recursive Part.
13
Book Example M2M Title –Can’t copyright © Publisher Edition Who’s asking? –Reader wants any copy of the “Book” –Buyer wants cheapest copy of the “Book” –Shakespeare: Good/Bad Quartos, 1 st -4 th Folios Adelaide Claxton Wonderland /
14
Compromise Who Cares? How many are there? Is it Worth It? What do you buy by accommodating it? What do you lose by not accommodating it? Economics in Action!
15
Hierarchies & Trees Powers of 2: G 2 For Genealogy, only 1 side –Patrilineal or Matrilineal 500 years ago –You had 1,000,000 forebears?!? Ancestral Village Who are you related to? Everyone in the Village!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.