Lecture 021
Lecture 021
Ovals are
attributes
ER Model
High-level data model diagram that defines the
conceptual view of the database
Describes data as a set of entities, attributes, and
relationships
Graphical view of the DB design
Model created based on business specifications or
narratives (from users or product owners)
ER Model
Business specifications:
Example: Bookstores Sales
We management more than one bookstore
Some customers haven’t bought books
Books are identified by a 10-digital ISBN code
We offer more than 10k books
Prices of books vary from $2 to $10,000
We keep all sales for at least ten years
ER Model – Key components
As mentioned before, the ER Model describes data
as a set of entities, attributes, and relationships.
The key components are:
Entities
Attributes
Relationships
ER Model – Key components
Entity: anything that can be described or have
additional information stored. An entity is something
that exists as itself.
Example:
BOOKSTORE
CUSTOMER (PERSON)
BOOK
ER Model – Key components
Attribute: Something that describes or qualifies an
entity (represented by rectangle with round corners or
sometimes ovals)
ER Model – Key components
Relationships: describe the relation between
two or more entities (represented by diamonds)
Examples: offers, buys
ER Model – Key components
Relationships continued:
An arrow indicates a Movie is owned by at
most one studio (many-one relationship)
Studios owns Movies
ER Model – Key components
Relationships continued:
When both sides of a relationship has
arrows, that indicates a 1:1 relation
Studios owns Movies
ER Model – Key components
Relationships continued:
Arrow with a rounded head means that not only is there a
Many:One relationship but also the one entity (e.g., Studio)
must exist (referential integrity)