Entity-Relationship Model (ER)
Miniworld
|
REQUIREMENTS COLLECTION AND ANALYSIS ---> Functional Requirements ---> FUNCTIONAL ANALYSIS ---> High-level Transaction Specification
|
Database Requirements
|
CONCEPTUAL DESIGN
|
Conceptual Schema (In a high-level data model)
|
LOGICAL DESIGN (DATA MODEL MAPPING)
DBMS-independent ----------------------------------------------------------------------------------------
DBMS-specific ---------------------------------------------------------------------------------------------
|
Logical (Conceptual) Schema (In the data model of a specific DBMS)
|
PHYSICAL DESIGN <--- High-level Transaction Specification ---> APPLICATION PROGRAM DESIGN ---> TRANSACTION IMPLEMENTATION ---> Applicationi Programs
|
Internal Schema (For the same DBMS)
Figure: Simplified phases of database design
Learn by example:
Design a DB for a company to store employee data
Company has:
A company has various depts
Each dept has:
Each project has a unique name number and a location
Each employee has
"Employee" vs "employee"
Dependents
Figure xxx
Each employee is assigned to one dept but may work on several projects.
Figure xxx
Detail P43 and P59
Entity - an object with conceptual existence
Attributes - properties of an entity. e.g. name, age, ID, ...
Value - assigned to an attribute
For example: Employee entity, ei and company entity ci
ei |
name = bubba addr = texas age = 45 phone = 612-6xx-xxxx (Attribute = Value) |
ci |
name = xxx addr = xxx ceo = bubba phone |
Simple Attributes are not divisible
==> atomic (Age = 5, GPA = 3.5)
Composite is divided into subparts
e.g. addr = street#, street name, city, state
Hierachy of Composite Attributes
addr |
city (atomic) state (atomic) zip (atomic) |
|
street addr |
number street name apt # |
Single - one value for a particular entity (e.g. age)
Multivalue - > 1 value or (lbound/lower bound, ubound/upper bound)
e.g. (fr, soph, jr, grad, openu)
s = start-date
c = current-date
employment-length = c - s
(Derived from c & s)
e.g. Number of employee = counting num of emp in Dept Entity
Null:
Student <- Entity Type
------
Name
------
ID
------
Sex
------
Entity Set (Extension)
e1 | Bubba | 123 | M |
e2 | John | 456 | M |
e3 | Sue | 665 | F |
Key
Domain of Attribute
e.g. month = (1, 12)
Relationship
Figure xxx
e1 and ej works for dk
Degree of ri = 2
Binary:
---- O ----
Tenary:
----- |
---- O ----
Shows # of relationship instances an entity can participate in
(M : 1)
1 : 1 = one-to-one
1: N = one-to-many
M:N = many to many
DEPENDENT --- name, [ ]
Two dependent has same name but belong to two different employment
OR
A Employee has two same name dependent
(When look at weak entity, we cannot unique identity who that is, e.g. dependent <- need to know the employee first).
In other words, Employee entity owns the dependent entries that are related to it.
Page 59 for all box labels
HW: What is Identifying Relationship Type means
Figure xxx: Employee, Supervision relationship
Need ER Model Homework