{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

er - E/RDiagrams WeakEntitySets ConvertingE/ 1...

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

View Full Document Right Arrow Icon
1 Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations
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
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.
Image of page 2
3 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.
Image of page 3

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

View Full Document Right Arrow Icon
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.
Image of page 4
5 E/R Diagrams In an entity-relationship diagram: Entity set = rectangle. Attribute = oval, with a line to the rectangle representing its entity set.
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 6
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.
Image of page 7

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

View Full Document Right Arrow Icon
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 .
Image of page 8
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.
Image of page 9

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

View Full Document Right Arrow Icon
10 Example : Relationship Set For the relationship Sells , we might have a relationship set like: 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
Image of page 10
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. But a 3-way relationship would.
Image of page 11

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

View Full Document Right Arrow Icon
12 Example : 3-Way Relationship Bars Beers Drinkers name name addr manf name addr license Preferences
Image of page 12
13 A Typical Relationship Set 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
Image of page 13

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

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

{[ snackBarMessage ]}