Data Modeling Using The Entity Relationship Model
Data Modeling Using The Entity Relationship Model
◉ We learned that:
3. We can query the database (retrieve data from tables in the database).
4. We can update the database (change, add, or delete data from tables in the
database).
◉Database State
Overview
◉Database Schema
This chapter
m 1
Employees Works_In Departments
SSN Name Name Location
Examples of Data Models (2)
Employees Departments
SSN Name
Name Location
Department
3. Logical and Physical design
1. Entities
2. Attributes
3. Relationships
1. Entities
◉ Entities example:
1. Entities
◉ Example #2:
◉ Entity Name: CAR
◉ Attributes:
◉ name, maker, VIN number
2. Attributes
Entity
Graphical representation
Man Woman First Last Date of
Birth
Name Name
Child Person
Baby
◉ Types of attributes:
◉ Types of attributes:
◉ Types of attributes:
3. Complex Attributes
A combination of composite and multivalued attributes
Ex. Telephone Number (002055……; 002011….)
2. Attributes
◉ Types of attributes:
◉ Types of attributes:
5. Null Values
Used in cases where attributes may not have values for a specific entity
1. Because the value is not applicable
Ex. ApartmentNo, CollegeDegrees, …
◉ Key attribute:
• Key attribute: An attribute that has to be unique and can be used to identify
an entity (Primary Key in the database)
Company Product
More than
Key attribute one
branch
Driven attribute
ER-Diagram example
??
Weak entity
3. Relationship
date
ER Diagram Notations
Entity Attribute
Composite attributes