FDBMS CH 1-3
FDBMS CH 1-3
FDBMS CH 1-3
SYSTEMS
CHAPTER 1 Introduction
Prepared By:-
Henok Ephrem(M.sc)
Page 1 of 146
Introduction to Database
data
Data can be defined as any type of representation of an object or an
event. Representation could be in the form of,number, text symbols, and
voice, static or dynamic image and so on
Information:-Information can be defined as a processed or summarized
data for a particular analysis or decision making.
Digital computers store data using two state components. With two such
states, we can represent exactly two different values. These two values
correspond to the two digits used by the binary number system or base 2
thatrequires just two symbols, _ 0_ 1, but the pattern remains the same as
for decimal. The digits are termed binary
digits. bits.
Page 2 of 146
Con’t
Database:
Page 3 of 146
Con’t
- Database contains the description of the data called
meta data - Each Database application will perform
the combination creating, reading, updating and
deleting data - Database designed once and used
simultaneously by many users.
Database - Is a shared collection of logically related
data and description of this data which designed to
meet the information needs of an organization - Is a
logically coherent collection of data with some inherent
meaning
Page 4 of 146
Advantages of database
Page 5 of 146
Con’t
Improved security – protection of the database from unauthorized access
Enforcement of standards – again integrations allows the database
administrator to define necessary standards
Increase productivity – it mostly use the fourth generation language
Improved maintenance through data independence –
Improved data accessibility and responsiveness – as a result of
integration data across subsystems is directly accessible to the end users
Improved backup and recovery services – facilitate and minimize the
amount of processing that can be lost following a failure
Increase concurrency – allow to access the same file simultaneously due to
integrity of information
Page 6 of 146
Disadvantage of database
Sense of ownership and responsibility easily lost
DB may become target of security breaches
Cost incurred to develop DBMS
Higher impact of failure
Complexity
Page 7 of 146
Con’t
Metadata:-
is "data [information] that provides information about other
data". Three distinct types of metadata exist: structural
metadata, descriptive metadata, and administrative
metadata.
Structural metadata is data about the containers of data. For
instance a "book" contains data, and data about the
book is metadata about that container of data.
Descriptive metadata uses individual instances of application
data or the data content.
For example, author, date created and date modified and file
size are examples of very basic document metadata.
Page 8 of 146
Con’t
Database Management System(DBMS ):-
- is a software package designed to store and manage
database - is a software system that allows users to
define, create and maintain a database and provide
controlled access to the data. - consists of a collection of
interrelated data and set of programs to access that data
- it is a software that is helpful in maintaining and utilizing
a database - are system in which interpretation and
storage of information are of primary importance
Page 9 of 146
Con’t
Page 10 of 146
Con’t
Page 11 of 146
Con’t
- allows users to define the database usually through
data definition language ( DDL ) which specify data
type structure and constraints on the data to be stored
in database
- it allows users to insert, update delete and retrieve
data from the database through data manipulation
language ( DML)
- it provides controlled access ( security, integrity,
concurrency, recovery …)
Page 12 of 146
Components of the DBMS Environment
Page 13 of 146
data model
Page 14 of 146
Con’t
DBMS example
SQL server
Oracle
Mysql
Microsoft Access
Page 15 of 146
Entities
Page 16 of 146
Relationships
Page 17 of 146
Relational databases
Page 18 of 146
Traditional File-Processing systems
Page 19 of 146
Con’t
- A collection of application programs that perform
services for end users, but each program defines
and manages its own data.
- Each and every subsystem of information systems
will have its own set files. As a result there will be a
duplication of data b/n various subsystems of the
information systems.
Page 20 of 146
Drawbacks of conventional file
based approach
Uncontrolled redundancy of data – due to
decentralized approach taken by each department
a file based approach lead to uncontrolled
duplication of data and this will lead
Additional disk space
Inconsistency of data integrity
It cost time and money
Page 21 of 146
Con’t
Data dependency – means the application program
depend on the data
Incompatible file format – the data depends on the
application programming language and this incompatibility
of such files makes them difficult to process jointly.
Inconsistency of data – a particular data element will
enter differently in different files.
Inflexibility – problem to provide a desired result as user
demand
Limited data sharing – due to decentralized data storing
mechanism there is less probability of data sharing
Page 22 of 146
Con’t
Poor enforcement of standards - different application
are developed by different group independentl
Excessive program maintenance – due to redundancy
recording system there will be also redundancy of
maintenance here and there and this take excessive
resources
Low programmer productivity – having decentralized
approach the programmer efficiency will be less
Page 23 of 146
Roles in the database environment
Page 24 of 146
Con’t
Database Administrator - a person having a
centralized control over data and program
accessing that data - focused on management of
technical aspects of the database system such as o
control the DB environment o standardize the use of
DB and associated software o support the
development and maintenance of DB application o
ensure all documentation related to standards and
implementation is up-todate
Page 25 of 146
Con’t
Database Designer o either logical or physical o
logical designer is concerned with identifying the
data relationship between the data constraints on
the data that is to be stored in the DB o physical
designer takes the logical data model and decides
the way in which it can be physically implemented
Page 26 of 146
Con’t
Application program o An program module which
provides the interface between the low level data
stored in database application program and
queries submitted to the system o DML, integrity
enforcement, security, backup and recovery
Page 27 of 146
Con’t
End users Individuals who interact with the
database to carryout business responsibilities
Sophisticated user – includes engineers, scientist,
business analyst, and others who thoroughly
familiarize themselves with the facilities of the
DBMS so as to implement their applications to meet
their complex requirements.
Page 28 of 146
Con’t
Naïve user – their main job function revolves around
constantly querying and updating the database using
standard types of queries and updates that have been
carefully programmed and tested such as bank tellers
check account balances and post withdrawals and
deposits. Reservation clerks for airlines, hotels and car
rental companies check availability for a given request
and make reservations.
Page 29 of 146
Review questions
Evolution of
database systems
???
Page 30 of 146
CHAPTER 2
THE DATABASE DEVELOPMENT PROCESS
Prepared By:-
Henok Ephrem(M.sc)
Page 31 of 146
information systems architecture
An information system architecture is a formal
definition of the business processes and rules,
systems structure, technical framework, and
product technologies for a business or
organizational information system.
An information system architecture usually consists
of four layers: business process architecture,
systems architecture, technical architecture, and
product delivery architecture.
Page 32 of 146
Con’t
The architecture of an information system encompasses the
hardware and software used to deliver the solution to the final
consumer of services.
The architecture is a description of the design and contents of a
computerized system. If documented, the architecture may include
information such as a detailed inventory of current hardware,
software and networking capabilities; a description of long-range
plans and priorities for future purchases, and a plan for upgrading
and/or replacing dated equipment and software.
The architecture should document: What data is stored, How does
the system function Where are components located, When do
activities and events occur in the system and Why does the system
exist
Page 33 of 146
Information engineering
Information engineering (IE) or information
engineering methodology (IEM) is a software
engineering approach to designing and
developing information system.
It can also be considered as the generation,
distribution, analysis and use of information in
systems.
Page 34 of 146
Con’t
Information engineering research is focused on
enhancing the decision making process through
knowledge discovery methods and information
modeling that helps us understand how information
is used within an enterprise.
Faculty working in this area conduct research
related to data mining, experimental design,
decision theory, and statistical analysis.
Page 35 of 146
Information Systems Planning
identifying strategic planning factors
identify corporate planning objectives
develop an enterprise model
Page 36 of 146
Database development process
Systems Development Life Cycle:- The major steps in
database design are;
Page 37 of 146
Con’t
3. Design: in database designing more emphasis is given to this phase.
The phase is further divided into three sub-phases.
1. Conceptual Design: concise description of the
data, data type, relationship between data and
constraints on the data.
• There is no implementation or physical detail
consideration.
• Used to elicit and structure all information
requirements
Page 38 of 146
Con’t
which describe the stature of the whole DB for
community of users
Conceptual schema hides the details of physical storage
structures and concentrates on describing entities, data
type, relationships user operations and constraints.
Describes all the data items and relationship between
data items together with integrity constraints
The implementation of conceptual schema is often
designed in high level data model.
Page 39 of 146
2.Logical Design:
a higher level conceptual abstraction with selected
specific data model to implement the data structure.
• It is particular DBMS independent and with no
other physical considerations.
Page 40 of 146
Con’t
- Often called view level which include a number of
external schemas or user view of the data
- Each external schema describes the part of the DB
that a particular user group is interested in and
hides the rest of the DB from the user group.
- External schema also typically implemented using
high level data model.
Page 41 of 146
3.Physical Design:
physical implementation of the upper level design
of the database with respect to internal storage
and file structure of the database for the selected
DBMS.
• To develop all technology and organizational
specification.
SQL Query
Page 42 of 146
Con’t
- which describe the physical storage structure of the
DB
- - describe how data is stored in the DB
- - it covers the data structure and organization used
to store data on storage devices
- - the complete description of the internal model
Page 43 of 146
Con’t
4. Implementation: the testing and deployment of the
designed database for use.
5. Operation and Support: administering and
maintaining the operation of the database system
and providing support to users.
Page 44 of 146
Con’t
Page 45 of 146
Con’t
Page 46 of 146
Alternative IS development Approaches
Prototyping
Packaged data models
CASE and Repository
Page 47 of 146
Different roles of team members involved in
a database development project
Page 48 of 146
Three-tiered Database Location
Architecture
Client tire
Application/Web server tier
Enterprise server tier
Page 49 of 146
Schema, instance and Database state
Page 51 of 146
Data independence
change the schedule at one level of a database system
without having to change the schema at the next higher level
Page 52 of 146
Database language
Page 53 of 146
Data Definition Language (DDL) -
A descriptive language that allows the DBA and
database designer to specify the database schema
or modify the existing one
Page 54 of 146
Data Manipulation Language (DML) -
Page 55 of 146
Con’t
There two types of DML :-
High level or non-procedural
describe only what output is to be obtained
a language that allows the user to state what data is
needed rather than how it is to be retrieved
four generation language (4GL)
use query language(SQL)
Low level or procedural
Specify how the data output of DML statement must be
obtained
a language that allows the user to tell the system what
data is needed and exactly how to retrieve the data
Cobol, FORTRAN, Pascal
Page 56 of 146
Data Control language(DCL)
The Data Control Language (DCL) is a subset of the
Structured Query Lanaguge (SQL) that allows
database administrators to configure security access
to relational databases.
Page 57 of 146
Database Model
Page 58 of 146
Con’t
- Data model is an integrated collection of concepts
for describing and manipulating data, relationships
between data, and constraints on the data in an
organization. - database model vary in both
complexity and richness however all data models
are equivalent as far as their ability to model
information concerned
Page 59 of 146
Con’t
-a data model consists of three main components:-
Page 60 of 146
Types of database model
Page 61 of 146
Con’t
- A record is a collection of field values that
provide information on an entity ( relationships
instance )
Each field has certain data type - A PCRs type: is
one-to-many relationship between two records
One side record type – parent record
Many side record type – child record
Page 62 of 146
Properties of network schema:-
- represents data as hierarchical tree structures
- Each hierarchy represents a number of related
records
- Allows a node to have only one parents which
means each child must have one and only one
parents
- Data is organized hierarchically just in the way
data is organized in a file cabinet
Page 63 of 146
Con’t
- Each relation ship must be explicitly the database
created
- Record of the same type are grouped into record
types
- One record type, called the root of the hierarchy
doesn’t participate in any PCR as a child record type.
- Every record, except the root, participates as a child
exactly one PCR type.
- A record type can participate as parent type in any
number of PCR types
Page 64 of 146
Con’t
Problem:- - It is difficult to search for items in the
bottom or middle of the hierarchy
- Are inflexible which is usually only a relatively small
set of pre defined queries that can be applied to the
data
- Inefficient at answering queries
- Inflexible and wholly unsuited to ad-hoc querying
- Many-to-many relationship is handled by duplication
of record instances
Page 65 of 146
Con’t
Page 66 of 146
Network model
- It was an extension of the hierarchical data model - The
differences are:
- In hierarchical data model, a child record has exactly
one parent
- In network data model, a child can have any number
of parents - It consists of two sets of structure
- Set of records
- Set of links - Each link type involves two record types,
parent and child record type
Page 67 of 146
Properties of network schema:-
Page 68 of 146
Con’t
- There is no restriction on how many links can be combined into link types.
- The child record type in one link can be the parents record type of another
link
- A given record type can be a parent in any number in any number of link
types.
- A given record type can be a child in any number of link types except root
- Direct link make system implemented using network model is very fast create
relationship among data through a linked list structure in which subordinates
records( member) can be linked more than one data element(owner)
- use index ( unique number) for searching item
Page 69 of 146
Con’t
Problem:- - the developers must anticipated every
possible question that users might ask about the
data - increase complexity - need huge amount of
processor time and storage space due to
fragmentation of data - flexibility does come at the
great complexity and duplication of data
Page 70 of 146
Con’t
Page 71 of 146
Relational model
- allows the definition of data structure, storage and retrieval
operation and integrity constraints
- in such database the data and relations between them are
organized in tables
- Each tables has a number of columns( attribute ) with unique
names - use high-level query language called SQL and
support a limited form of user views
- it allows files to be related by means of a common field
- the relational database model is based on the mathematical
concept of a relation, which is physically represented as a
table
Page 72 of 146
Con’t
- relational data model employs three basic notations:
entity sets
relationship sets
attributes
- best features :-
allows a high degree of data independence
provide substantial grounds for dealing with data semantics, consistency
and redundancy problems
the development of structured query language
the strength of the relation database is a designer does not need to know
which questions might be asked of the database. If the data is carefully
defined the database can answer virtually any question
Page 73 of 146
Con’t
Page 74 of 146
Object-Oriented model
- Defines in terms of objects, their properties, and their
operations
- - An object contains values stored in instance variables
within the object
- - An object also contains bodies of code that operate
on the object called methods.
- - Objects that contain the same types of values and
same methods are grouped into classes
- - A class may be viewed as a type definition for
objects.
Page 75 of 146
Con’t
- Objects with the same structure and behavior belong to a
Class, and Class are organized into hierarchies. The
operations of each class are specified in terms of
predefined procedures called methods.
- - The only way in which one object can access the data of
another object is by invoking the method of that other
object, this is called sending message to the object.
- - The internal parts of the object, the instance variables and
method code, are not visible externally called data and
method hiding.
Page 76 of 146
Example of OO Model
Class employee /* methods are usually defined
{ separattley from the class
/*variables or attributes*/ definition.*/
Private: string get-address( )
string name; {
string address; return address;
date start-date; }
int salary; int set-address(string new-
/*Methods*/ address)
Public: {
int annual-salary( ); address = new-address;
string get-name( ); }
string get-address( ); int employment-length( )
int set-address(string new-address); {
int employment-length( ); return today( ) – start-date;
} }
Page 77 of 146
Exercise
1. Define the following terms: data 2. Discuss the ANSI-SPARC
model, database schema, architecture
database state, internal schema,
conceptual schema, external
schema , data independence, DDL,
DML
Reading
Assignment
???
3. What is the difference between a 4. Describe the three-schema architecture.
database schema and a database Why do we need mapping between schema
state? levels? How do different schema definition
languages support this architecture?
Page 78 of 146
Con’t
5. What is the difference 6. What is the difference between
procedural and nonprocedural
between logical data DMLs?
independence and physical
data independence?
Reading
Assignment
???
7. What is the difference between the
two tier architecture and three tier 8. Discuss the main
architecture? categories of data models
Page 79 of 146
CHAPTER 3
DATABASE ANALYSES
Prepared By:-
Henok Ephrem(M.sc)
Page 80 of 146
Data Modeling
Page 81 of 146
Business Rule
Page 82 of 146
Scope of Business rules
Page 83 of 146
Gathering business rules
Page 84 of 146
Data names and definition
Page 85 of 146
The E-R Model
The E-R (entity-relationship) data model views the real
world as a set of basic objects (entities) and
relationships among these objects.
E-R data model is based on perception or real world
that consists of a set of basic object called entities and
of relationships among these object
The relational model is based on the mathematical
concept of a relation which is physically represented as
a table
Page 86 of 146
Con’t
- The E-R data model employs three basic notations:
Entity sets
Relationship sets
Attributes
Page 87 of 146
Entity sets
Page 88 of 146
Type of entity:-
Person – employee, student, patient
Place – store, workhouse, state
Page 89 of 146
Classification of Entity Sets
Page 90 of 146
Con’t
Page 91 of 146
Con’t
Consider customer borrows loan. Here loan is a
weak entity. For every loan, there should be at least
one customer. Here the entity loan depends on the
entity customer hence loan is a weak entity.
Page 92 of 146
Attribute
A property of an entity or a relationship set.
An attribute domain is the set of allowable values for one
more attributes
Every entity is described by a set of (attribute, data value)
pairs, one pair for each attribute of the entity set
An attribute are descriptive properties proposed by each
member of an entity set
An attribute is used to describe the properties of the entity.
This attribute can be broadly classified based on value and
structure.
Page 93 of 146
Con’t
Page 94 of 146
Con’t
- An attribute, as used in E-R model, can be characterized by the
following attribute types:
- Simple attribute– an attributes that can’t be divided into
subparts(other attributes)
Eg. Pobox number, age of a person
- - Composite attribute – is the one which can be further subdivided
into simple attributes
Eg. Consider an attribute name which can be further subdivided into
first name, middle name, last
name.
- Address which has also subparts like street name, city and state.
Degree earned by a particular scholar,etc
Page 95 of 146
Con’t
Page 96 of 146
Con’t
Page 97 of 146
Con’t
Page 98 of 146
Relationship and Relationship sets -
A relationship is an association between two or more entities
A relationship set is a set of relationships of the same type
Eg. CUSTOMER – ACCOUNT
to denote the association between customers and accounts
(degree 2)
Class schedule could be relate INSTRACTOR-SECTION-
COURSE and ROOM entities.( degree 4)
the number of entity sets that participate in a relationship
set is know as the degree of the relationship set
Page 99 of 146
ER Diagram
one-to-many (1:*)
or many-to-many (*:*)
- A branch may sale all items or may only sale certain item.
- - Orders are composed of one or more items.
- - Information record about order, order date, create authorization status.
- - Information recorded for each item description, color, size, pattern, type
an item can be composed of multiple items.
- - Information record about each employee name address (street, city, state,
PO Box) telephone date of birth, title salary skill age.
- - Each employee works in one and only one branch.
- - We want to keep track of the dependant of each employee for insurance
purpose. We may wish to record the name of the dependent as well as age
and relationship.
- - Employee can have one or more skill.