Professional Documents
Culture Documents
02 ch7 1
02 ch7 1
DATABASE DESIGN
Chapter 7.1:
Entity-Relationship Model
Design Process
Modeling (E-R Model)
Constraints
E-R Diagram
Design Issues
Weak Entity Sets
Extended E-R Features
Design of the Bank Database
Reduction to Relation Schemas
Database Design
UML
Advantages
Flexible for changing the structure
Insertion, deletion and modification is easy
Little skill is required to developed and understand
Accessing and updating is very fast
Advantages
Conceptual Simplicity
Visual Representation
Effective Communication Tool
Integrated with Relational Database Model
Entity
Attribute
Relationship
Properties of
Entity Type Entity
Instance
Properties of
Entity Type
DEPENDENT
EMPLOYEE
Partial
Identifying
Identifier Identifier
Relationship
Strong
Weak
Entity Type
Entity Type
Database System Concepts 7.25 ©Silberschatz, Korth and Sudarshan
Entity Relationship Model
Naming Entity Type
Singular Name, placed inside the box
Specific to organization
Name should be Capital
Abbreviation can be used (e.g STUDENT=STD, EMPLOYEE=EMP,
etc…)
Entity type is indicated by Rectangle
CUSTOMER ORDER
Job
Ename Address
Date_Employed
EMPLOYEE
Skill
Domain of an Attribute
Set of possible value for an attribute is called domain
Domain can be used for the boundaries check
Attribute in an entity set get the value from the same domain
Required Attribute
The attribute that must have a value for every instance
E.g ID in every table
Optional Attribute
The attribute that may not have a value for every entity instance. E.g:
hobbies attribute in a table
The attribute without a value is said to be null.
Optional
Attribute
Addres
Name
s
Multi Value
Attribute
Job
Ename Address
EMPLOYEE
Skill
Example
Date_Employed attribute used in EMPLOYEE entity type used to
calculate Years_Employed
Or from DOB of person we can calculate Age of person.
Derived
Attribute
Date_
Employed Years_
Ename Employed
EMPLOYEE
Skill
Partial Identifier
Examples
STUDENT Completes COURSES
Noun -------verb--------noun
Other examples like: student writes examination
Student attends class
Driver drives car (a driver at a time drives only one car)
Completes
STUDENT COURSE
STUDENT COURSE
Roll_No Completes Course_ID
Name (…) Course_Title
Birt_data {Topic}
First_Name Middle_Name
Last_Name
Title
Roll_No Name DOB
Course_ID
Topic
Attribute on
Relationship
Teach_Duration
Teach_Time
Title
Staff_No Name Course_ID
Man
ages
EMPLOYEE
Lives
with
A PERSON lives with another person: PERSON
STUDENT DEPARTMENT
STUDENT COURSE
The above relationship means that one chairman runs only one department.
Similarly, one department is run by one chairman
COUNTRY has PRESIDENT
The above relationship means that one country has one president. Similarly,
one president is of only one country.
The above relationship means that one state can have many cities, but one city
is belonged to one state.
The above relationship means that one university can have many departments,
but one department is part of only one university.
The above relationship means that one std may study many courses and
one course may be studied by many students.
The above relationship means that one employee can learn many skills and
one skill can be learned by many employees.
The above relationship means that one or many vendors with one or many
warehouses supplies one or many parts.
The last relationship means that one or many analysts with one or many
programmers work on one or many projects.
Completes
STUDENT COURSES
Each student completes one or more then one courses but for each course
there may or may not exist student who complete the course.
Mandatory One
Mandatory Many
Optional One
Optional Many
A B
A B
A B