Database System
Arsi University
1
Fundamental of Database
System
Target Dept.:- Computer Science
kedir E.(MSc) By:kedir E.
2
Lecture One
Introduction to Database System
Arsi University
Kedir E.
Outline
3
1.1 Overview
1.2 Basics of database
1.3 File organization vs Database approach
1.4 Users and Actors of Database System (Actors on the scene)
1.5 Characteristics of Database Approach
kedir E.(MSc)
Arsi University
1.1. Overview
4
Today, people use computers in order to perform many tasks
formerly done by other tools.
1. Computer has replaced typewriters for creating, storing and
modifying documents.
2. Computer has supported scientific calculators as the best way to
do mathematical operations.
3. Computer also replaced millions of papers and file folders as the
principal storage medium for important information.
Compared to those old tools, computers do much more, much
kedir E.(MSc)
faster and with greater accuracy
Cont’d…
5
Databases Are Everywhere
Database = a large (?) collection of related data
Classically, a DB models a real-world organisation (e.g., enterprise,
university)
– Entities (e.g., students, courses)
– Relationships (e.g., “Martin is taking IDS in 2010/11”)
Changes in the organisation = changes in the database
Examples:
personnel records
banking
airline reservations
kedir E.(MSc)
Cont’d…
6
What is Data?
Data's are raw facts.
Representation of facts, concepts, or instructions in a
formalized manner that should be suitable for communication,
interpretation, or processing by a human or electronic machine.
E.g. Person Name, Age, Gender and Weight
What is information?
Data is organized, classified, or presented to make them meaningful
or useful value for the receiver..
kedir E.(MSc)
Cont’d…
7
Information to be meaningful the processed data must qualify for the
following characters.
Timely - information should be available when required.
Accuracy -information should be accurate.
Completeness -information should be complete.
Information is:
Contextualized: We know for what purpose the data was gathered.
Categorized: We know the units of analysis of key components of data.
Calculated: The data may have been analysed mathematically or statistically.
Corrected: Errors have been removed from the data.
Condensed: The data may have been summarized in a more concise form.
E.(MSc)
kedir
Cont’d…
8
What is a Database ?
collection of logically related data.
E.g. Books database in library, student database in university.
DB is a collection of information that is organized so that it can be easily
accessed, managed, and updated.
a database is nothing more than a collection of shared
information/data that exists over a long period of time, often many
years.
The term database refers to a collection of data that is managed by a
DBMS.
kedir E.(MSc)
Cont’d…
9
Databases properties:
Represents some aspects of the real world. (mini world or the
universe of discourse)
A database is a logically coherent collection of data with some
meaning.
A database is designed, built, and populated with data for a
specific purpose.
kedir E.(MSc)
Cont’d…
A database system consists of: 10
Data (the database)
Software
Hardware
Users
We focus mainly on the software
Database systems allow users to:
Store
Update
Retrieve
Organize
kedir E.(MSc)
1.2. Basic of Database and DBMS
11
Nowadays, this data is typically stored in mobile phones,
which have their own simple database software.
This data can also be recorded in an indexed address book or stored
on a hard drive, using a personal computer and software such as
Microsoft Access or Excel.
This collection of related data with an implicit meaning is a
database.
kedir E.(MSc)
Cont’d…
12
The power of databases comes from a body of knowledge and
technology that has developed over several decades and is
embodied in specialized software called a DBMS.
Database + DBMS = Database System
A DBMS is a powerful tool or Software for creating and
managing large amounts of data efficiently and allowing it to
persist over long periods of time, safely.
Examples: Oracle, DB2 (IBM), MS SQL Server, HSQLDB, MS Access
(Microsoft), Ingres, PostgreSQL, MySQL, SQLite (open source).
kedir E.(MSc)
Cont’d…
Simplified database system environment
13
kedir E.(MSc)
Typical DBMS Functionality
14
Define a particular database in terms of its data types, structures,
and constraints.
Construct or Load the initial database contents on a secondary
storage medium.
Manipulating the database:
Retrieval: Querying, generating reports
Modification: Insertions, deletions and updates to its content
Accessing the database through Web applications
Processing and Sharing by a set of concurrent users and
application programs – yet, keeping all data valid and consistent
kedir E.(MSc)
Typical DBMS Functionality…
15
Other features:
Protection or Security measures to prevent
unauthorized access
“Active” processing to take internal actions on data
Presentation and Visualization of data
Maintaining the database and associated programs over
the lifetime of the database application
Called database, software, and system maintenance
kedir E.(MSc)
So, the DB course is about:
16
How to organize data
Supporting multiple users
Efficient and effective data retrieval
Secured and reliable storage of data
Maintaining consistent data
Making information useful for decision making
kedir E.(MSc)
Some Database System Applications:
17
Banking: all transaction.
Airlines: reservations, schedules
Universities and college: registration, grades
Sales: customers, products, purchases
Manufacturing: production, inventory, orders, supply chain
Human resources: employee records, salaries, tax deductions
Health Centre: Medical records
Credit card details
Customer histories
kedir E.(MSc)
and so on…
Example of a Database (with a Conceptual Data Model)
Mini-world for the example: 18
Part of a UNIVERSITY environment.
Some mini-world entities:
STUDENTs, COURSEs, SECTIONs (of COURSEs), (academic) DEPARTMENTs,
INSTRUCTORs
Some mini-world relationships:
SECTIONs are of specific COURSEs
STUDENTs take SECTIONs
COURSEs have prerequisite COURSEs
INSTRUCTORs teach SECTIONs
COURSEs are offered by DEPARTMENTs
kedir E.(MSc)
Example of simple database
19
kedir E.(MSc)
Database Development Life Cycle
20
The major steps in database design are;
1. Planning: that is identifying information gap in an organization
and propose a database solution to solve the problem.
2. Analysis: that concentrates more on fact finding about the
problem or the opportunity. Feasibility analysis, requirement
determination and structuring, and selection of best design
method are also performed at this phase.
3. Design: in database designing more emphasis is given to this
phase. The phase is further divided into three sub-phases.
kedir E.(MSc)
Database Development Life Cycle …
21
The design phase is further divided into three sub-phases:
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
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.
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.
kedir E.(MSc)
Database Development Life Cycle …
22
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.
kedir E.(MSc)
Impact of databases and database technology
Businesses: Banking, Insurance,
23
Retail, Transportation,
Healthcare, Manufacturing
Service industries: Financial, Real-estate, Legal,
Electronic Commerce, Small businesses
Education : Resources for content and Delivery
More recently: Social Networks, Environmental and
Scientific Applications, Medicine and Genetics
Personalized applications: based on smart mobile
devices
kedir E.(MSc)
1.3. File organization vs Database approach
24
Data management passes through the different levels of
development along with the development in technology and
services.
These levels could best be described by categorizing the levels into
three levels of development.
Manual Approach
Traditional file based approach
Database approach
kedir E.(MSc)
Cont’d…
1. Manual Approach 25
In the manual approach, data storage and retrieval follows the
primitive and traditional way of information handling where
cards and paper are used for the purpose.
The data storage and retrieval will be performed using human
labour.
Files for as many event and objects as the organization has are
used to store information. Each of the files containing various
kinds of information is labelled and stored in one or more
cabinets.
kedir E.(MSc)
Cont’d…
Limitation of Manual 26
Approach
Prone to error
Difficult to update, retrieve, integrate
You have the data but it is difficult to compile the
information
Limited to small size information
Cross referencing is difficult
kedir E.(MSc)
Cont’d…
2. Traditional File Based Approach
27
File based systems were an early attempt to computerize the
manual filing system.
This approach is the decentralized computerized data handling
method.
Since every application defines and manages its own data, the
system is subjected to serious data duplication problem
kedir E.(MSc)
Cont’d…
28
kedir E.(MSc)
Cont’d…
Limitation of the Traditional
29
File Based Approach
Separation or Isolation of Data:
Limited data sharing
Lengthy development and maintenance time
Duplication or redundancy of data
Data dependency on the application
Incompatible file formats between different applications and
programs creating inconsistency.
Fixed query processing which is defined during application
kedir E.(MSc)
development
Cont’d…
The most significant problem 30
experienced by the traditional file
based approach of data handling are the following three types of
anomalies;
Modification Anomalies: a problem experienced when one ore more
data value is modified on one application program but not on others
containing the same data set.
Deletion Anomalies: a problem encountered where one record set is
deleted from one application but remain untouched in other application
programs.
Insertion Anomalies: a problem experienced when ever there is new
data item to be recorded, and the recording is not made in all the
kedir E.(MSc)
applications.
Cont’d…
3. Database Approach 31
Database is a shared collection of logically related data designed
to meet the information needs of an organization.
Since it is a shared corporate resource, the database is
integrated with minimum amount of or no duplication.
Database is a collection of logically related data where these
logically related data comprises entities, attributes, relationships,
and business rules of an organization's information.
kedir E.(MSc)
Cont’d…
Database Approach … 32
In addition to containing data required by an organization,
database also contains a description of the data which called as
“Metadata” or “Data Dictionary” or “Systems Catalogue” or
“Data about Data”.
Database is deigned once and used simultaneously by many users.
Unlike the traditional file based approach in database approach
there is program data independence.
That is the separation of the data definition from the application.
kedir E.(MSc)
Cont’d…
Database Approach … 33
Each database application will perform the combination of:
Creating database,
Reading,
Updating and
Deleting data.
kedir E.(MSc)
Cont’d…
Benefits of Database Approach
34
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 accessibility of data: by using SQL, 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
kedir E.(MSc)
Cont’d…
Benefits of Database Approach
35 …
Transaction support can be provided: basic demands of any
transaction support systems are implanted in a full scale DBMS.
Integrity can be maintained: data at different applications will be
integrated together with additional constraints to facilitate shared
data resource.
Security majors can be enforced: the shared data can be secured
by having different levels of clearance and other data security
mechanisms.
Improved decision support: the database will provide information
kedir E.(MSc)
Cont’d…
Benefits of Database Approach
36 …
Compactness: since it is an electronic data handling method, the
data is stored compactly (no voluminous papers).
Speed: data storage and retrieval is fast as it will be using the
modern fast computer system.
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.
kedir E.(MSc)
Cont’d…
Benefits of Database Approach
37 …
Restricting unauthorized access to data. Only the DBA staff
uses privileged commands and facilities.
Providing persistent storage
Providing backup and recovery services
kedir E.(MSc)
Cont’d…
38
kedir E.(MSc)
Cont’d…
Limitation and risk of Database
39 Approach
Introduction of new professional and specialized personnel.
Complexity in designing and managing data
The cost and risk during conversion from the old to the new system
High cost to be incurred to develop and maintain the system
Complex backup and recovery services from the users perspective
Reduced performance due to centralization and data independency
High impact on the system when failure occurs to the central system.
kedir E.(MSc)
1.4. Users and Actors of Database System
(Actors on the scene)
40
kedir E.(MSc)
Cont’d…
41
As people are one of the components in DBMS environment, there
are group of roles played by different stakeholders of the designing
and operation of a database system.
Database Administrator
Database Designer
Application programmer and system analyst
End users
kedir E.(MSc)
Cont’d…
42
1. Database Administrators
Responsible to oversee, control and manage the database
resources (the database itself, the DBMS and other related
software)
Authorizing access to the database
Coordinating and monitoring the use of the database
Responsible for determining and acquiring hardware and
software resources.
Accountable for problems like poor security, poor
kedir E.(MSc)
performance of the system
Cont’d…
43
Database Administrators…
Data Administrator vs Database Administrator
Data Administrator (DA): is responsible on management of
data resources. Involves in database planning, development,
maintenance.
Database Administrator (DBA): is more technically oriented
role. Responsible for the physical realization of the database.
Involves in physical design, implementation, security and
integrity control of the database.
kedir E.(MSc)
Cont’d…
44
2. Database Designers
Identifies the data to be stored and choose the appropriate
structures to represent and store the data.
Should understand the user requirement and should choose
how the user views the database.
Involve on the design phase before the implementation of the
database system.
We have two distinctions of database designers,
one involving in the logical and conceptual design and
kedir E.(MSc)
another involving in physical design.
Cont’d…
Database Designers… 45
Logical and Conceptual DBD
Identifies data (entity, attributes and relationship) relevant
to the organization
Identifies constraints on each data
Understand data and business rules in the organization
Physical DBD
Take logical design specification as input and decide how it
should be physically realized.
kedir E.(MSc)
Cont’d…
46
3. Application Programmer and System analyst (Software Engineers)
System analyst determines the user requirement and how the
user wants to view the database.
The application programmer implements these specifications as
programs; code, test, debug, document and maintain the
application program.
Determines the interface on how to retrieve, insert, update and
delete data in the database.
Such analysts and programmers—commonly referred to as software
developers or software engineers
kedir E.(MSc)
Cont’d…
47
4. End Users
Workers, whose job requires accessing the database frequently for
various purpose.
There are different group of users in this category.
1. Naïve user
2. Sophisticated user
3. Casual user
4. Stand-alone user
kedir E.(MSc)
Cont’d…
End Users… 48
1. Naïve or parametric end users
Sizable proportion of end users
Unaware of the DBMS
Only access the database based on their access level and demand
Use standard and pre-specified types of queries.
Ex.
• Bank customers and tellers check account balances and post
withdrawals and deposits.
• Reservation agents or customers for airlines, hotels, and car
rental companies check availability for a given request and make
kedir E.(MSc)
Cont’d…
End Users… 49
2. Sophisticated Users
Are users familiar with the structure of the Database and
facilities of the DBMS.
Are most of the time engineers, scientists, business analysts,
who try to learn most of the DBMS facilities in order to achieve
their complex requirements.
kedir E.(MSc)
Cont’d…
End Users… 50
3. Casual user
Users who access the database occasionally.
Need different information from the database each time.
Use sophisticated database queries to satisfy their needs.
Are most of the time middle to high level managers
kedir E.(MSc)
Cont’d…
End Users… 51
4. Stand-alone user
Mostly maintain personal databases using ready-to-use
packaged applications.
An example is the user of a tax program that creates its own
internal database.
Another example is a user that maintains a database of
personal photos and videos.
kedir E.(MSc)
Actors Behind the scene
System designers and implementers:
52 Design and implement
DBMS packages in the form of modules and interfaces and test and debug
them. The DBMS must interface with applications, language compilers,
operating system components, etc.
Tool developers: Design and implement software systems called tools
for modeling and designing databases, performance monitoring, prototyping,
test data generation, user interface creation, simulation etc.
Operators and maintenance personnel: They manage the actual
running and maintenance of the database system hardware and software
environment.
kedir E.(MSc)
1.5. Characteristics of Database Approach
53
Self-describing nature of a database system:
A DBMS catalog stores the description of a particular database (e.g.
data structures, types, and constraints)
The description is called meta-data*.
This allows the DBMS software to work with different database
applications.
Insulation between programs and data:
Called program-data independence.
Allows changing data structures and storage organization without
having to change the DBMS access programs
kedir E.(MSc)
Cont’d…
Example of simplified database
54 catalogue
kedir E.(MSc)
Cont’d…
55
Data abstraction:
A data model is used to hide storage details and present
the users with a conceptual view of the database.
Programs refer to the data model constructs rather than data
storage details
Support of multiple views of the data:
Each user may see a different view of the database, which
describes only the data of interest to that user.
kedir E.(MSc)
Cont’d…
56
Sharing of data and multi-user transaction processing:
Allowing a set of concurrent users to retrieve from and to update the
database.
Concurrency control within the DBMS guarantees that each
transaction is correctly executed or aborted
Recovery subsystem ensures each completed transaction has its effect
permanently recorded in the database
OLTP (Online Transaction Processing) is a major part of database
applications; allows hundreds of concurrent transactions to execute per
second.
kedir E.(MSc)
Historical Development of Database Technology
Reading Assignment 57
Early Database Applications Using Hierarchical and Network
Systems
The Hierarchical and Network models were introduced in mid 1960s and dominated during
the seventies.
A bulk of the worldwide database processing still occurs using these models, particularly,
the hierarchical model using IBM’s IMS system.
Providing Data Abstraction and Application Flexibility with
Relational Databases
Relational model was originally introduced in 1970, was heavily researched
and experimented within IBM Research and several universities.
kedir E.(MSc)
Cont’d…
Object-Oriented Applications and
58 the Need for More Complex
Databases
Object-Oriented Database Management Systems (OODBMSs) were introduced in
late 1980s and early 1990s to cater to the need of complex data processing in
CAD and other applications.
Their use has not taken off much
Many relational DBMSs have incorporated object database concepts, leading to a
new category called object-relational DBMSs (ORDBMSs)
Extended relational systems add further capabilities (e.g. for multimedia data,
text, XML, and other data types)
kedir E.(MSc)
Cont’d…
Interchanging Data on the59Web for E-Commerce Using
XML
Web contains data in HTML (Hypertext markup language) with
links among pages
Has given rise to a new set of applications and E-commerce is using
new standards like XML (eXtended Markup Language).
Script programming languages such as PHP and JavaScript allow
generation of dynamic Web pages that are partially generated from a
database.
kedir E.(MSc)
Also allow database updates through Web pages
Cont’d…
Extending Database Capabilities
60for New Applications
New functionality is being added to DBMSs in the following areas:
Scientific applications – physics, chemistry, biology, genetics
Spatial: weather, earth and atmospheric sciences and astronomy
XML (eXtensible Markup Language)
Image storage and management
Audio and video data management
Time series and historical data management
Emergence of Big Data Storage Systems and NOSQL Databases
New data storage, management and analysis technology was necessary to deal with the
onslaught of data in petabytes a day (10**15 bytes or 1000 terabytes) in some applications
– this started being commonly called as “Big Data”.
kedir E.(MSc)
Kedir E (MSc)
61
End of Chapter One
kedir E.(MSc)