In Last Lecture
Traditional File System
Database Technology
Program Data Independence
Minimal Data Redundancy
Improved Data Sharing
Rapid Application Development
Enforcement of standards
Improve Data Quality
Improved Data Accessibility and Responsiveness
Reduced Program Maintenance
Evolution of Database Technology
Functions of DBA
Planning
Identifying User Requirements
Study the current system and its output
Interview the different users to know their
current and future requirements
Developing and maintaining Data Dictionary
Characteristics of entities like length and type of
name
Functions of DBA
Designing Logical Model
After analyzing user environment, the DBA
develop a logical data model
Data model consists of all entities, attributes and
relationships
Choosing a DBMS
Select DBMS on the basis of Logical Data Model
The DBMS should satisfy the all requirements
and constraints of Logical Data Model
Functions of DBA
Developing Physical Model
Create the exact layout of data according to the
selected DBMS and available resources of
Software and Hardware
Creating and Loading Database
After developing physical model the DBA create
the structure of database by using DBMS
Load the data into database
Functions of DBA
Developing User Views
Guide the user about the functionality of the project,
If any request of user is not satisfied, DBA should
justify it.
Developing and Enforcing Data Standards
Data in database must be inserted according to the
standards required by the organization.
The DBA ensures that the inserted data always
according to these standards.
Data Integrity and Consistency
Functions of DBA
Developing Operating Procedures
Procedures includes security and authentication
Recording hardware and software failures
Taking performance measurements
Shutting down and restarting database properly
Recovering the database incase of any failure
Functions of DBA
Training the user
The DBA should train the users so that they may
use the database effectively
Defining Recovery and Backup Procedures
If any portion of database is damaged by human
error or hardware, it should be restore as soon
as possible
The backup is compulsory and it may be recover
in case of emergency.
Functions of DBA
Monitoring Performance
Respond to the complaints or suggestions of the users
DBA should make sure that the database should
always work in its optimum performance
If any problem the DBA should solve it.
Tuning and Reorganization
If performance is disturbed due to huge amount of
data the DBA should tune it
In some case the DBA may have to change the
physical model and reload the database.
Database Development System
General Strategies
Top-Down Development
General to Specific Issues
Bottom-Up Development
Specific to General
Design Stages
Analyze User Environment
Develop Conceptual Model
Map Conceptual Model to Logical
Choose DBMS
Develop Physical Design
Implement System
Test System
Operational Maintenance
Analyze Existing System
Objective: To understand the working of
existing system
Analyze users’ requirements
Tool Used
Why to use at all?
Data Flow Diagrams
Database Development Process
Similar to
Preliminary Study software
Requirement
developmen
Analysis process
DB Design
Physical Design
Implementation
Maintenance
Enterprise Modeling/ Planning
Analyze current data processing
Analyze the general business functions and
their database needs
Justify the need of new databases in support
of business
Conceptual Data Modeling
Identify the scope of database
requirements
Analyze overall data requirements for
business functions supported by
database
Develop preliminary conceptual data
model, including entities and
relationship
Develop detailed conceptual data
model including all entities and
relationships
Conceptual Data
Modeling
Logical Database Design
Analyze in detail the transactions, form,
displays and inquiries required by the
business functions and supported by
database
Identify data integrity and security
requirements
Logical Database Design
Logical Database Design
Logical Database Design
Physical Design
Define database to DBMS
Decide physical organization of data
Design database processing programs
Database Implementation
Code and test database processing
programs
Complete database documentation and
training materials
Install database and convert data from
prior systems
Database Maintenance
Ensure evolving information requirements
are met
Tune database for improved performance
Fix error in database and database
application
Recover database when it is contaminated
Database Development Process
Enterprise Modeling
Conceptual Data Modeling
Logical Database Design
Physical Database Design and definition
Database Implementation
Database Maintenance
Data Modeling
Crucial phase in Database development
Technology independent analysis of the
organization's data
Output of this phase will be ERD(Entity
Relationship Diagram) that model common
Business Rules
Data Modeling
In Short we perform two activities in this
phase
1. Make Entity Relationship Diagram
2. Collect and Documents Business Rules
Entity Relationship Model
Introduced by Peter Chen(1976)
Entity Relationship Model is logical
representation of data for an organization
Define Entities and relationships and their
associated attributes in an organization
using some common notations and
conventions
Entity Relationship Model
ER- Model consists of three basic
components:
1. Entities
2. Attributes
3. Relationships
The E-R Model
Entity Relationship Diagram is graphical
representation of E-R Model
Unfortunately, there is no standard
notations for ERD
Entity Relationship Diagram
Entity Relationship Model
ER- Model consists of three basic
components:
1. Entities
2. Attributes
3. Relationships
Entity
Entity is a person, place, object, event,
or concept in the user environment
about which the organization wishes to
maintain data
Entities are represented as
boxes(rectangles) in ER-Diagram
Entities
Person: EMPLOYEE,STUDENT,PATIENT
Place: STORE, WAREHOUSE,STATE
Object:MACHINE,BUILDING, AUTOMOBILE
Event: SALE,REGISTRATION
Concept:ACCOUNT,COURSE,
Entity Type & Entity Instance
Entity Type:
A collection of entities that share
common properties and characteristics
Entity Instance: A single
occurrence of an entity type in a specific
environment
Entity Type
Entity Type: EMPLOYEE Attributes:
EMPLYEE NUMBER CHAR(10)
NAME CHAR(25)
DEPARTMENT CHAR(20)
DATE HIRED DATE
Designaton
Salary
Timing
Department
Contact #
Address
Off day
Martial status
Blood group
Date of birth
Entity Instance
Here we have two instances of
EMPLOYEE entity type:
642-17-8360 534-10-8360
ahmad hassan ali mehmood
Accounts Manufacturing
03-21-1992 02-10-1982
Strong Entity types
Entity type that exists independently of
other entity types is called strong entity
STUEDNT, AUTOMOBILE etc.
Strong entity always has a unique
characteristics(attribute) called
identifier
Weak Entity types
Weak Entity is an Entity type whose
existence depends on some other entity
Weak Entity type has no business
meaning without the entity(Identifying
Owner) on which it depends
Weak entity does not have its own
identifier
Weak Entity types
Entity type Selection
Entity Selection is critical issue in ERD
design
ERD is not a Data Flow Diagram(DFD)
Suppose in a business environment one
treasure manages the accounts of business
according to the expenses. He generates
expense report after one week.
Example ERD
Correct
Incorrect
Naming Entity Types
Entity name is a singular noun and
should write is capital letters in ERD
Name should be specific to the
organization
Entity Name should be concise
Event Entity Types should be named for
the result of the event, not the activity of
the process of the event
Attributes
Each entity has a set of attributes
associated with it
Attribute is a property or characteristic
of an entity types that is of interest of an
organization
Attributes
STUDENT
Student_ID,Student_Name,Home_Address,
Phone_Number,Blood_Group
AUTOMOBILE
Vehicle_ID,Color,Weight,Horsepower
EMPLOYEE
Employee_ID, Employee_Name,Skill
Attributes
First letter of the attribute name should be
capital letter
Use under score(_) between two or more
words i.e. Employee_ID
In ERD we use ellipse to represent
attributes of an entity type
Now a days its better to write attributes
inside the ERD
Employee_i
d
Attributes
Attributes in ERD
DEPENDENT_NAME
Employee_ID Employee_Name Date_of_Birth
EMPLOYEE Has DEPENDENTS
Types of Attributes
We can distinguish between the following
types of the attributes
1. Required Versus Optional Attributes
2. Simple vs. Composite Attributes
3. Single-Values vs. Multi-valued Attributes
4. Stored vs. Derived Attributes
5. Identifier Attributes
Attributes
Required versus Optional
An attribute that must be present for each
entity instance is called a required attribute,
Whereas an attribute that may not have a value
is called an optional attribute.
Simple Vs. Composite
Composite Attribute
An attribute that can be broken down into
meaningful component parts
For example Address can be further divided
into Street_Address, City,State,Postal_Code
Address (Street_Address,
City,State,Postal_Code)
Simple Vs. Composite
Street_Address City
Province
First_Name Last_Name
Address
Name
Simple Vs. Composite
Simple Attribute
It is type of attribute that cannot further
divided into smaller parts
For AUTOMOBILE entity type attributes
Vehicle_ID,Color,Weight etc. are examples
of simple attributes
Single Valued Vs. Multi-valued
Employee_Name
Employee_ID Skill
EMPLOYEE
A Multi-Valued attribute is an attributes
which may take more than one value for
a given entity instance
Multivalued attribute is written as:
{Skill: graphic design, web, sql,
oracle}
Stored vs. Derived
Derived Attributes
• An attributes whose value can be
calculated from related attributes(Stored
in database or not)
• For Example: [Years_Employed]
Identifier Attributes
An identifier attribute is a type of attribute
that uniquely identify every entity
instance
Student_ID in STUDENT entity type and
Employee_ID in EMPLOYEE
Identifier are underlined in Entity
Relationship Diagram(ERD)
Identifiers
Employee_Name
Employee_ID Skill
EMPLOYEE
Yea
rs_E
m ploy
ed
Date_Employed
Identifier Attributes
An identifier attribute is a type of attribute
that uniquely identify every entity
instance
Student_ID in STUDENT entity type and
Employee_ID in EMPLOYEE
Identifier are underlined in Entity
Relationship Diagram(ERD)
Composite Identifier Attribute
Composite identifier is one that consists
of more than one attributes
An entity type may have more than one
identifier
m ber
t _ Nu Da
h te
Flig
Flight_ID Passenger_Name
Flight
Identifier Selection
Chose an identifier that will not change its
value
The attribute is guaranteed to have a valid
value and not to be Null
Avoid the use of intelligent identifiers or
keys, whose structure shows classification,
location, so on