0% found this document useful (0 votes)
98 views50 pages

PCIT 02 Chapter 1 of Fundamental of Database System

Uploaded by

kaye layan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views50 pages

PCIT 02 Chapter 1 of Fundamental of Database System

Uploaded by

kaye layan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Fundamental of

Database System
Chapter 1
Introduction to Database-System
EMILVERCHRISTIAN V. ARQUERO

CENTRAL PHILIPPINES STATE UNIVERSITY


Chapter 1:
Introduction to Database-System
▪ Database System Applications
▪ Database Characteristics
▪ Database Users
▪ Advantages of Using the DBMS Approach
▪ Architecture
▪ Data Models, Schemas, Independence
▪ Database Languages in DBMS

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


What Is a Database?
Database is an organized collection of structured information, or data,
typically stored electronically in a computer system. A database is
usually controlled by a database management system (DBMS).

A database consists of both data and


metadata. Metadata is the data that
describes the data’s structure within
a database.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database System Applications
The Database Management System (DBMS) is defined as a software
system that allows the user to define, create and maintain the database
and provide control access to the data.

Applications of DBMS
Reservation System
Library Management System
Universities and colleges
Social Media Sites
FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY
Database Characteristics
Earlier File Management System
was used to manage data
needed for a specific
application. In File Management
System, each user stores
separate data for the
application even if the same
data is stored by another user.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Characteristics
Database Approach is used for
storing and maintaining the
data where the data is defined
once and stored in a single
location and accessed by
multiple users from this
location.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Characteristics
The main characteristics of the database approach versus the file-
processing approach are the following:

▪ Self-describing nature of a database system


▪ Insulation between programs and data, and data abstraction
▪ Support of multiple views of the data
▪ Sharing of data and multiuser transaction processing

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Self-Describing Nature of a
Database System
In the traditional file management system, data definition was not a
part of the application, but in the database approach, the data is
defined by the users and this defined data describes itself.

It means that the metadata or data about data is also stored in the
database, specifically in the DBMS catalog.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


What is this metadata?
Metadata means data about
data, like the constraints in the
database, the structure of the
database, the columns of the
database, etc.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Insulation between Programs and
Data,
and Data Abstraction
The DBMS or Database
Management
System provides the
conceptual view of the data
that is easily readable to the
user and hides many details
of the data such as how the
data is stored or the
constraints used on the data.
This conceptual view is
known as the data model.
FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY
Support of Multiple Views of the
Data
Database typically has many types of users, each of whom may require
a different perspective or view of the database. A view may be a subset
of the database or it may contain virtual data that is derived from the
database files
In the Database Approach, a single database is implemented and
multiple users access this database

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Sharing of Data and Multiuser
Transaction Processing
Sharing of data means that multiple users are accessing common data
like a dean and the head of the department are accessing the
STUDENTS database.

Multi-user Transaction Processing as the name implies that the


database must allow multiple users to process their respective
transactions. But it should also ensure that the transactions are
processed concurrently so that multiple users can't change a record at
the same instant.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
Database users are categorized based up on their interaction with the
database.
1. Database Administrator (DBA) is a person/team who defines the
schema and also controls the 3 levels of database. The DBA will then
create a new account id and password for the user if he/she need to
access the database.
DBA is also responsible for providing security to the database and he
allows only the authorized users to access/modify the data base. DBA is
responsible for the problems such as security breaches and poor
system response time.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
▪ DBA also monitors the recovery and backup and provide technical
support.
▪ The DBA has a DBA account in the DBMS which called a system or
superuser account.
▪ DBA repairs damage caused due to hardware and/or software
failures.
▪ DBA is the one having privileges to perform DCL (Data Control
Language) operations such as GRANT and REVOKE, to allow/restrict
a particular user from accessing the database.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
2. Database Designers are the users who design the structure of
database which includes tables, indexes, views, triggers, stored
procedures and constraints which are usually enforced before the
database is created or populated with data.
It controls what data must be stored and how the data items to be
related. It is responsibility of Database Designers to understand the
requirements of different user groups and then create a design which
satisfies the need of all the user groups.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
3. End users are the people whose jobs require access to the database
for querying, updating, and generating reports; the database primarily
exists for their use. There are several categories of end users:

▪ Casual end users occasionally access the database, but they may
need different information each time. They use a sophisticated
database query interface to specify their requests and are typically
middle- or high-level managers or other occasional browsers.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
▪ Parametric End Users are the unsophisticated who don’t have any
DBMS knowledge but they frequently use the database applications
in their daily life to get the desired results.
▪ Sophisticated end users include engineers, scientists, business
analysts, and others who thoroughly familiarize themselves with the
facilities of the DBMS in order to implement their own applications
to meet their complex requirements.
▪ Standalone users maintain personal databases by using ready-made
program packages that provide easy-to-use menu-based or
graphics-based interfaces.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Users
4. System Analyst is a user who analysis the requirements of
parametric end users. They check whether all the requirements of end
users are satisfied.

5. Application Programmers also referred as System Analysts or simply


Software Engineers, are the back-end programmers who writes the
code for the application programs. They are the computer
professionals.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Advantages of Using the DBMS
Approach
The advantages of using a DBMS and the capabilities that a good DBMS
should possess. These capabilities are in addition to the four main
characteristics. The DBA must utilize these capabilities to accomplish a
variety of objectives related to the design, administration, and use of a
large multiuser database.

Controlling Redundancy: Redundancy is controlled when the DBMS


ensures that multiple copies of the same data are consistent. This
redundancy in storing the same data multiple times leads to several
problems.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Advantages of Using the DBMS
Approach
Controlling Redundancy:

Figure 1. Denormalization

Figure 2. Normalization

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Advantages of Using the DBMS
Approach
Restricting Unauthorized Access: When multiple users share a large
database, it is likely that most users will not be authorized to access all
information in the database.
In addition, some users may only be permitted to retrieve data, whereas
others are allowed to retrieve and update.

Providing Persistent Storage for Program Objects: The persistent storage of


program objects and data structures is an important function of database
systems. Traditional database systems often suffered from the so-called
impedance mismatch problem, since the data structures provided by the
DBMS were incompatible with the programming language’s data structures.
FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY
Advantages of Using the DBMS
Approach
Providing Storage Structures and Search Techniques for Efficient
Query Processing: Database systems must provide capabilities for
efficiently executing queries and updates. Because the database is
typically stored on disk, the DBMS must provide specialized data
structures and search techniques to speed up disk search for the
desired records.
Providing Backup and Recovery: A DBMS must provide facilities for
recovering from hardware or software failures. The backup and
recovery subsystem of the DBMS is responsible for recovery

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Advantages of Using the DBMS
Approach
Providing Multiple User Interfaces: Because many types of users with
varying levels of technical knowledge use a database, a DBMS should
provide a variety of user interfaces. These include apps for mobile
users, query languages for casual users, programming language
interfaces for application programmers, forms and command codes for
parametric users, and menu-driven interfaces and natural language
interfaces for standalone users.
Representing Complex Relationships among Data: A database may
include numerous varieties of data that are interrelated in many ways

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Advantages of Using the DBMS
Approach
Enforcing Integrity Constraints: Most database applications have
certain integrity constraints that must hold for the data. A DBMS should
provide capabilities for defining and enforcing these constraints. The
simplest type of integrity constraint involves specifying a data type for
each data item.
Permitting Inferencing and Actions Using Rules and Triggers: Some
database systems provide capabilities for defining deduction rules for
inferencing new information from the stored database facts. Such
systems are called deductive database systems

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
A brief historical overview of the applications that use DBMSs and how
these applications provided the impetus for new types of database
systems.

1. Early Database Applications Using Hierarchical and Network


Systems: Many early database applications maintained records in large
organizations such as corporations, universities, hospitals, and banks. In
many of these applications, there were large numbers of records of
similar structure.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
Early Database Applications Using Hierarchical and Network Systems
One of the main problems with early database systems was the
intermixing of conceptual relationships with the physical storage and
placement of records on disk
Another shortcoming of early systems was that they provided only
programming language interfaces. This made it time-consuming and
expensive to implement new queries and transactions, since new
programs had to be written, tested, and debugged.
Most of these database systems were implemented on large and
expensive mainframe computers starting in the mid-1960s and
continuing through the 1970s and 1980s.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
2. Providing Data Abstraction and Application Flexibility with
Relational Databases: Relational databases were originally proposed to
separate the physical storage of data from its conceptual
representation and to provide a mathematical foundation for data
representation and querying.
Early experimental relational systems developed in the late 1970s and
the commercial relational database management systems (RDBMS)
introduced in the early 1980s were quite slow, since they did not use
physical storage pointers or record placement to access related data
records.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
3. Object-Oriented Applications and the Need for More Complex
Databases: The emergence of object-oriented programming languages
in the 1980s and the need to store and share complex, structured
objects led to the development of object-oriented databases (OODBs).
They also incorporated many of the useful object-oriented paradigms,
such as abstract data types, encapsulation of operations, inheritance,
and object identity
They are now mainly used in specialized applications, such as
engineering design, multimedia publishing, and manufacturing
systems.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
4. Interchanging Data on the Web for E-Commerce Using XML: The
World Wide Web provides a large network of interconnected
computers. Users can create static Web pages using a Web publishing
language, such as HyperText Markup Language (HTML), and store these
documents on Web servers where other users (clients) can access them
and view them through Web browsers. Documents can be linked
through hyperlinks, which are pointers to other documents.
Starting in the 1990s, electronic commerce (e-commerce) emerged as a
major application on the Web.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
5. Extending Database Capabilities for New Applications: Database
systems now offer extensions to better support the specialized
requirements for some of these applications. The following are some
examples of these applications:
▪ Scientific applications
▪ Data mining applications
▪ Spatial applications
▪ Time series applications

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


A Brief History of Database
Applications
6. Emergence of Big Data Storage Systems and NOSQL Databases: In
the first decade of the twenty-first century, the proliferation of
applications and platforms such as social media Web sites, large e-
commerce companies, Web search indexes, and cloud storage/backup
led to a surge in the amount of data stored on large databases and
massive servers.
The term NOSQL is generally interpreted as Not Only SQL, meaning that
in systems than manage large amounts of data, some of the data is
stored using SQL systems, whereas other data would be stored using
NOSQL, depending on the application requirements.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


When Not to Use a DBMS
In spite of the advantage of using a DBMS, there is some situation in
which a DBMS may involve unnecessary overhead costs that would not
be incurred in traditional file processing. The overhead cost of using a
DBMS is due to the following:
▪ High initial investment in hardware, software, and training.
▪ The basic property that DBMS provide is defining and processing of
data.
▪ Overhead for providing security, concurrency control, recovery and
integrity functions.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


When Not to Use a DBMS
Additional problems may arise if the database designers and DBA don’t
properly design the database or if the database systems application is
not implemented properly. Hence it may be more desirable to use
regular files under the following circumstances.
▪ We can use a regular file system when we know that a simple
database is not going to change.
▪ Stringent, real-time requirements for some programs that may not
be met because of DBMS overhead.
▪ No multiple user access to data.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Data Models
Data Model is the modeling of the
data description, data semantics, and
consistency constraints of the data.
four data models used for
understanding the structure of the
database:
▪ Relational Data Model
▪ Entity-Relationship Data Model
▪ Object-based Data Model
▪ Semistructured Data Model Types of Data Models

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Data Models
Relational Data Model: This type of
model designs the data in the form of
rows and columns within a table.
Thus, a relational model uses tables
for representing data and in-between
relationships. Tables are also called
relations.
This model was initially described by
Edgar F. Codd, in 1969.
Relational Data Model

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Data Models
Entity-Relationship Data Model: An
ER model is the logical representation
of data as objects and relationships
among them. These objects are
known as entities, and relationship is
an association among these entities.
This model was designed by Peter
Chen and published in 1976 papers.

Entity-Relationship Data Model

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Data Models
Object-based Data Model: An
extension of the ER model with
notions of functions, encapsulation,
and object identity, as well. This
model supports a rich type system
that includes structured and collection
types. Thus, in 1980s, various
database systems following the
object-oriented approach were
developed. Object-based Data Model

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Data Models
Semistructured Data Model: This type
of data model is different from the
other three data models. The
semistructured data model allows the
data specifications at places where the
individual data items of the same type
may have different attributes sets

Semistructured Data Model

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


DBMS Architecture
The DBMS design depends upon its
architecture. The basic client/server
architecture is used to deal with a
large number of PCs, web servers,
database servers and other
components that are connected with
networks.
DBMS architecture depends upon
how users are connected to the
database to get their request done. Types of DBMS tier

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


3-tier Architecture
A 3-tier architecture separates its tiers
from each other based on the
complexity of the users and how they
use the data present in the database.

Database (Data) Tier − At this tier, the


database resides along with its query
processing languages. We also have
the relations that define the data and
their constraints at this level.
3-tier architecture

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


3-tier Architecture
Application (Middle) Tier − At this tier reside the application server
and the programs that access the database. For a user, this application
tier presents an abstracted view of the database. End-users are
unaware of any existence of the database beyond the application.

User (Presentation) Tier − End-users operate on this tier and they


know nothing about any existence of the database beyond this layer.
All views are generated by applications that reside in the application
tier

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Schema
A database schema is the skeleton
structure that represents the logical
view of the entire database. It defines
how the data is organized and how the
relations among them are associated.

It’s the database designers who design


the schema to help programmers
understand the database and make it Two categories of database schema
useful.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


2 categories of database schema
Physical Database Schema − This schema pertains to the actual
storage of data and its form of storage like files, indices, etc. It defines
how the data will be stored in a secondary storage.

Logical Database Schema − This schema defines all the logical


constraints that need to be applied on the data stored. It defines
tables, views, and integrity constraints.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Instance
Once the database is operational, it is very difficult to make any
changes to it. A database schema does not contain any data or
information.

A database instance is a state of operational database with data at any


given time. It contains a snapshot of the database. Database instances
tend to change with time.
A DBMS ensures that its every instance (state) is in a valid state

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Database Languages in DBMS
A DBMS has appropriate
languages and interfaces to
express database queries and
updates.

Database languages can be


used to read, store and update Types of Database Languages
the data in the database.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Database Languages
Data Definition Language (DDL) Here are some tasks that come under
It is used to define database structure DDL:
or pattern. ▪ Create: It is used to create objects
It is used to create schema, tables, ▪ Alter: It is used to alter the structure
indexes, constraints, etc. in the ▪ Drop: It is used to delete objects
database. ▪ Truncate: It is used to remove all
records from a table.
Data definition language is used to
▪ Rename: It is used to rename an
store the information of metadata like
object.
the number of tables and schemas,
their names, indexes, columns in each ▪ Comment: It is used to comment on
table, constraints, etc. the data dictionary.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Database Languages
Data Manipulation Language (DML) it is used for accessing and
manipulating data in a database. It handles user requests.

Here are some tasks that come under DML:


▪ Select: It is used to retrieve .
▪ Insert: It is used to insert data into a table.
▪ Update: It is used to update existing data within a table.
▪ Delete: It is used to delete all records from a table.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Database Languages
Data Control Language (DCL) It is used to retrieve the stored or saved
data.
The DCL execution is transactional. It also has rollback parameters.

Here are some tasks that come under DCL:


▪ Grant: It is used to give user access privileges to a database.
▪ Revoke: It is used to take back permissions from the user.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Database Languages
Data Control Language (DCL) It is used to retrieve the stored or saved
data. The DCL execution is transactional. It also has rollback
parameters.
Here are some tasks that come under DCL:
▪ Grant: It is used to give user access privileges to a database.
▪ Revoke: It is used to take back permissions from the user.
There are the following operations which have the authorization of
Revoke:
CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY


Types of Database Languages
Transaction Control Language (TCL) is used to run the changes made
by the DML statement. TCL can be grouped into a logical transaction.

Here are some tasks that come under TCL:


Commit: It is used to save the transaction on the database.
Rollback: It is used to restore the database to original since the last
Commit.

FUNDAMENTAL OF DATABASE SYSTEM CENTRAL PHILIPPINES STATE UNIVERSITY

You might also like