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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 1 Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations 2 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. 3 Framework for E/R Design is a serious business. The boss knows they want a database, but they dont know what they want in it. Sketching the key components is an efficient way to develop a working database. 4 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. 5 E/R Diagrams In an entity-relationship diagram: Entity set = rectangle. Attribute = oval, with a line to the rectangle representing its entity set. 6 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) Beers name manf 7 Relationships A relationship connects two or more entity sets. It is represented by a diamond, with lines to each of the entity sets involved. 8 Example : Relationships 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 . 9 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. 10 Example : Relationship Set For the relationship Sells , we might have a relationship set like: Bar Beer Joes Bar Bud Joes Bar Miller Sues Bar Bud Sues Bar Petes Ale Sues Bar Bud Lite 11 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....
View Full Document

This note was uploaded on 02/21/2011 for the course CS 147 taught by Professor Dr.jeff during the Fall '07 term at SUNY Buffalo.

Page1 / 68

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

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

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