
Entity-Relationship Model. E-R Diagrams Class hierarchies Weak entity sets. Purpose of E/R Model. The E/R model allows us to sketch the design of a database informally. Designs are pictures called entity-relationship diagrams .
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
customer
Attributes Types,cont…Example: Date of birth and Age
Age
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
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
Sells
Bars
Beers
price
Attributes on Relationships depends on the type of relationship.
In one-to-one and one-to-many relationship the attributes can be associated with one of the participating entity sets rather than with the relationship set, while in many-to-many the attribute must be associated with relationship set.
Example: one -to-many (one customer may have several accounts but each account is held by only one customer).
In this case , access time [when the customer last access that account] be associated with account entity
customer account
Ahmad
Amjad
Khaled
deposit
account
customer
28
Access time
The relationship attribute can be associated with either one of the participating entity set.
In this case , access time [when the customer last access that account] be associated with customer or account entity.
The relationship attribute must be associated with the relationship set.
In this case , access time [when the customer last access that account] must be associated with depositor relationship set, because if it was an attribute of account , we can’t determine which customer last access the joint account.
deposit
account
customer
30
Access time
customer account
Ahmad
Amjad
Khaled
customer account
Ahmad – 24/4/2007
Amjad – 11/5/2006
Khaled – 25/7/2007
borrower
loan
customer
dept
number
hours
room
Courses
name
number
name
Plays-
on
Players
Teams
Specialization: is a process of defining subgroup within an entity set
Top-down level
Beers
name
manf
High Level [super class]
isa
Ales
XYZ
color
Low Level [subclass]
Taste
Person
city
name
High Level [super class]
isa
salary
customer
employee
id
Low Level [subclass]
C-id
job
Works on
branch
employee
manages
manager
work
job
Works on
branch
employee
manages
manager
name
name
addr
ManfBy
Beers
Manfs
This design gives the address of each manufacturer exactly once.
name
name
addr
ManfBy
Beers
Manfs
manf
This design states the manufacturer of a beer twice: as an attribute and as a related entity.
or
name
name
addr
ManfBy
Beers
Manfs
name
manf
Beers
There is no need to make the manufacturer an entity set, because we record nothing about manufacturers besides their name.
name
name
ManfBy
Beers
Manfs
Since the manufacturer is nothing but a name, and is not at the “many” end of any relationship, it should not be an entity set.