er-ullman - Entity-Relationship Model E/R Diagrams Weak...

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

View Full Document Right Arrow Icon
Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations Following lecture slides are from Jeff Ullman’s slides  http://infolab.stanford.edu/~ullman/dscb.html#slides   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
Purpose of E/R Model The E/R model allows us to sketch database schema designs. Includes some constraints, but not operations. Designs are pictures called entity- relationship diagrams . Later : convert E/R designs to relational DB designs. 2
Background image of page 2
Framework for E/R Design is a serious business. The “boss” knows they want a database, but they don’t know what they want in it. Sketching the key components is an efficient way to develop a working database. 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Entity Sets Entity = “thing” or object. Entity set = collection of similar entities. Similar to a class in object-oriented languages. Attribute = property of (the entities of) an entity set. Attributes are simple values, e.g. integers or character strings, not structs, sets, etc. 4
Background image of page 4
E/R Diagrams In an entity-relationship diagram: Entity set = rectangle. Attribute = oval, with a line to the rectangle representing its entity set. 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
Example : Entity set Beers has two attributes, name and manf (manufacturer). Each Beers entity has values for these two attributes, e.g. (Bud, Anheuser-Busch) 6 Beers name manf
Background image of page 6
Relationships A relationship connects two or more entity sets. It is represented by a diamond, with lines to each of the entity sets involved. 7
Background image of page 7

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

View Full DocumentRight Arrow Icon
Example : Relationships 8 Drinkers addr name Beers manf name Bars name license addr Note: license = beer, full, none Sells Bars sell some beers. Likes Drinkers like some beers . Frequents Drinkers frequent some bars .
Background image of page 8
Relationship Set The current “value” of an entity set is the set of entities that belong to it. Example : the set of all bars in our database. The “value” of a relationship is a relationship set , a set of tuples with one component for each related entity set. 9
Background image of page 9

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

View Full DocumentRight Arrow Icon
Example : Relationship Set For the relationship Sells , we might have a relationship set like: 10 Bar Beer Joe’s Bar Bud Joe’s Bar Miller Sue’s Bar Bud Sue’s Bar Pete’s Ale Sue’s Bar Bud Lite
Background image of page 10
Multiway Relationships Sometimes, we need a relationship that connects more than two entity sets. Suppose that drinkers will only drink certain beers at certain bars. Our three binary relationships Likes , Sells , and Frequents do not allow us to make this distinction. But a 3-way relationship would. 11
Background image of page 11

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

View Full DocumentRight Arrow Icon
Example : 3-Way Relationship 12 Bars Beers Drinkers name name addr manf name addr license Preferences
Background image of page 12
A Typical Relationship Set 13 Bar Drinker Beer Joe’s Bar Ann Miller Sue’s Bar Ann Bud Sue’s Bar Ann Pete’s Ale Joe’s Bar Bob Bud Joe’s Bar Bob Miller Joe’s Bar Cal Miller Sue’s Bar Cal Bud Lite
Background image of page 13

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

View Full DocumentRight Arrow Icon
Many-Many Relationships Focus: binary relationships, such as Sells between Bars and Beers . In a
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/13/2011 for the course CSCE 520 taught by Professor Farkas during the Spring '11 term at South Carolina.

Page1 / 68

er-ullman - Entity-Relationship Model E/R Diagrams Weak...

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

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