database system chapter1
database system chapter1
(SWEG2108)
Chapter – 1
Introduction to Database Systems
Chapter 1 Outline
• Introduction:
– What is data, database, etc..
– Database characteristics
– What is DBMS
– Typical Database System
• Data Management Approaches:
– Manual Approach
– File Approach
– Database Approach
• DBMS: Functions
• Database System Environments
06/16/22 2
Introduction
06/16/22 4
Terms: Record, Tuples, Field, Attribute, Domains,
Table, Relation, Database …..
Database: Collection of related relations. Consider the following collection
of tables.
Discussion: We now have a collection of 4 tables. They can be called a “related collection”
because we can clearly find out that there are some common attributes existing in a selected
pair of tables. Because of these common attributes we may combine the data of two or more
tables together to find out the complete details of a student. Questions like “Which hostel
does the youngest student live in?” can be answered now.
06/16/22 5
Introduction
•Database Systems
•A database is organized collection of related data of an
organization stored in formatted way which is shared by multiple
users.
•The main feature of data in a database are:
o 1. It must be well organized
o 2. It is related
o 3. It is accessible in a logical order without any difficulty
o 4. It is stored only once
•Example: Suppose the roll no, name, address of a student stored
in a student file. It is collection of related data with an implicit
meaning. Data in the database may be persistent, integrated and
shared.
06/16/22 7
Introduction
•Database Systems
•Discussion: Within a company there are different departments, as well as customers, who
each need to see different kinds of data. Each employee in the company will have different
levels of access to the database with their own customized front-end application.
06/16/22 8
A simplified Database System Environment.
06/16/22 9
Data Management Approaches
06/16/22 10
1. Manual File Handling Systems
The primitive and traditional way of information handling where
cards and papers are used for the purpose.
Manual Approach:
Requires intensive human labour
Write Events and objects on files (paper)
Label and store files in one or more cabinets.
Keep cabinets in safe places for security purpose.
Insertion and retrieval is done by searching first for the right
cabinet then for the right file, then the information.
One could have indexing system to facilitate access to the data.
06/16/22 11
Example Personal Calendar
We might start by building a file with the following
structure:
What Day Time With_whom Where
06/16/22 12
Let us also build our address book
Name Phone#
– Abebe A. 0911164743
– Seble K. 0912150844
– Ayele L. 0913170841
– Elfinesh W. 0911169673
– Ermias H. 0912151043
– Worku A. 0911199904
– Worku D. 0912620410
– Abebe D. 0914556768
06/16/22 13
Limitations of Manual File Handling
A) Problem of Data Organization
Suppose we want to cancel one of our appointments.
Two conceptual “entities” -- address and calendar -- with a
relationship between them, linking people in the calendar to their
contact information.
B) Problem of Efficiency
Size of your personal address book is probably less than one hundred
entries, but there are things we'd like to do quickly and efficiently.
“Give me all appointments on 10/28”
“When am I next meeting Dr. Dawit?”
What would happen if you were using a business calendar with hundreds
of thousands of entries?
06/16/22 14
Limitations of Manual File Handling …
C) Prone to error
D) Difficult to update, retrieve, integrate
E)You have the data but it is difficult to compile the
information
F) Significant amount of duplication of data
G) Cross referencing is difficult
06/16/22 15
File Based Approach
06/16/22 16
Database Approach
06/16/22 17
2. File-Based Approach
File based systems were an early attempt to computerize the manual filing
system.
This approach is a decentralized computerized data handling method - to
develop a program or a number of programs for each different application.
Since every application defines and manages its own data, the system is
subjected to serious data duplication problem
06/16/22 18
Limitations of File-Based systems
Data Redundancy (Duplication of data)
• Same data is held by different programs
• Wasted space (Uncontrolled duplication of data)
Separation and isolation of data
• Each program maintains its own set of data.
• Users of one program may be unaware of potentially useful data
held by other programs.
• Limited data sharing
• Special codes for different queries
Data Inconsistency and confusion
• Eg. Consider an organization
• Personnel Department stores details relating to each member.
• Payroll Department stores salaries of each staff
06/16/22 19
Limitations of File-Based systems…
Data Dependence
• File structure is defined in the program code and is
dependent on the application programming language.
• Each application program must have its own processing
routines for reading, inserting, updating and deleting data.
06/16/22 20
Limitations of File-Based systems…
Difficulty of Data Sharing: Suppose payroll wants to know when
a certain employee will be on pension. It is difficult to share this
information unless we have another application programmer to
write software to convert the files to some common format.
Poor Security and Administration: Unauthorized people may
access the data.
Anomalies: Three types:
(1) Modification Anomalies: A problem experienced when one or
more data value is modified on one application program but not
one others containing the same data set.
(2) Deletion Anomalies: A problem encountered where one record
set is deleted from one application but remain untouched in other
application programs.
(3) Insertion Anomalies: A problem experienced whenever there is
a new data item to be recorded, and the recording is not made in
all the applications.
06/16/22 21
3. Database Approach
06/16/22 22
3. Database Approach…
A Database is a shared collection of logically related data
designed to meet the information needs of an
organization- (Centralized System).
06/16/22 23
3. Database Approach…
This definition is stored in the system catalog, which
contains information such as the structure of each
file, type and storage format of each data item and
various constraints on the data..
The information stored is called metadata and it
describes the structure of the primary database.
06/16/22 24
DBMS Functions
A DBMS performs several important functions that guarantee the
integrity and consistency of the data in the database.
Most of those functions are transparent to end users, and most
can be achieved only through the use of a DBMS.
06/16/22 25
DBMS Functions…
06/16/22 26
Advantages of Database Systems
Data can be shared: two or more users can access and use same
data instead of storing data in redundant manner for each user
Improved Data Accessibility - By using structured query
languages, the users can easily access data without programming
experience.
Redundancy can be reduced: Isolated data is integrated in
database to decrease the redundant data stored at different
applications
Quality data can be maintained: the different integrity
constraints in the database approach will maintain the quality
leading to better decision making.
Inconsistency can be avoided: controlled data redundancy will
avoid inconsistency of the data in the database to some extent.
06/16/22 27
Advantages of Database Systems…
06/16/22 28
Advantages of Database Systems…
Less Labor: Unlike the other data handling methods,
data maintenance will not demand much resource
Centralized information control: Since relevant data in
the organization will be stored at one repository, it can be
controlled and managed at the central level.
Data Independence - Applications insulated from how
data is structured and stored
06/16/22 29
Limitations and Risk of DB Approach
Although the database system yields considerable advantages
over previous data management approaches, database
systems do carry significant disadvantages.
1)Increased Costs.
– Database systems require sophisticated hardware and software
and highly skilled personnel.
– The cost of maintaining the hardware, software, and personnel
required to operate and manage a database system can be
substantial.
– Training, licensing, and regulation compliance costs are often
overlooked when database systems are implemented.
06/16/22 30
Limitations and Risk of DB Approach…
2) Management Complexity:
– Database systems interface with many different
technologies and have a significant impact on a company’s
resources and culture.
3) Maintaining Currency:
– To maximize the efficiency of the database system, perform
frequent updates and apply the latest patches and security
measures to all components. Because database technology
advances rapidly, personnel training costs tend to be
significant.
4) Vendor Dependence:
– Given the heavy investment in technology and personnel
training, companies might be reluctant/unwilling to change
database vendors.
5) Frequent Upgrade/Replacement Cycles
– DBMS vendors frequently upgrade their products by adding
new functionality.
06/16/22 31
Database System Environment
06/16/22 32
Database System Environment
06/16/22 33
Database System Environment
06/16/22 34
Database System Environment
06/16/22 35
Database Development Methodology
• We can not develop a database through judgment. (though
possible)
06/21/22 SWEG2108 36
Database Development Lifecycle (Can
not be developed by judgment!!!)
• Database planning
• Requirements collection and analysis
• Define Problems and Constraints
• Database design
• DBMS selection
• Prototyping
• Implementation
• Data conversion and loading
• Testing
• Operational maintenance
06/21/22 SWEG2108 37
12
Database Planning
– Analyze the Company Situation
• What is the organization’s general operating environment, and what is its mission within
that environment?
• What is the organization’s structure?
– Identifies work to be done; the resources with which to do it; and the money to pay for it all.
– preliminary assessment (time, budget, etc..)
– Integrated with the overall IS strategy of the organization.
06/21/22 SWEG2108 38
14
Define Problems and Constraints - described in the user’s
language
• How does the existing system function?
• What input does the system require?
• What documents and reports does the system generate?
• How is the system output used? By Whom?
• What are the operational relationships among business units?
• What are the limits and constraints imposed on the system?
• Use modeling techniques for formal documentation (Eg. DFD)
06/21/22 SWEG2108 39
17
DBMS Selection
• The selection of an appropriate DBMS to support the database application.
• Undertaken at any time prior to logical design provided sufficient information is
available regarding system requirements.
• Also design the user interface and the application programs using the selected
DBMS
06/21/22 SWEG2108 40
21
Prototype Development Stages
06/21/22 SWEG2108 41
24
Implementation
• The physical realization of the database and application designs.
– Use DDL of DBMS to create database schemas and empty database
files.
– Use DDL to create any specified user views.
• Data Conversion and Loading
– Transferring any existing data into the new database and converting
any existing applications to run on the new database.
– Only required when a new database system is replacing an old
system.
– DBMS normally have a utility that loads existing files into the new
database.
– Where applicable, it may be possible to convert and use application
programs from the old system for use by the new system.
06/21/22 SWEG2108 42
25
Testing
• The process of executing the application programs with the intent of finding
errors.
– Use carefully planned test strategies and realistic data.
– Testing cannot show the absence of faults; it can show only that
software faults are present.
– Demonstrates that database and application programs appear to be
working according to requirements.
Operational Maintenance
– The process of monitoring and maintaining the system following
installation.
– Monitoring the performance of the system.
– If performance falls, may require reorganization of the database.
– Maintaining and upgrading the database application (when required).
– Incorporating new requirements into the database application.
06/21/22 SWEG2108 43
27
Life Cycle
Database Planning
Systems Definition
Requirements Collection
and analysis
Application
DBMS Database Design Design
Selection
Implementation
Testing