Vous êtes sur la page 1sur 70

What is database?

A shared collection of logically related data and a

description of this data.


It is designed to meet the information needs of an
organization
This organized collection of data is usually in
digital form.

What is the differences between data and


information?
Data : Numbers, characters, symbols, images
etc., which can be processed by a computer.
Data must be interpreted, by a human or

machine, to derive meaning

Information : Knowledge derived from study,


experience (by the senses), or instruction.
Information is the interpreted data

How data storage and retrieval has changed


overcomes.
The use of database in our daily life.

How data storage and retrieval has changed


overcomes.
The use of database in our daily life.

Purchases from the supermarket


Purchasing using credit cards
Booking a holiday at the travel agents
Using local library
Renting a video
Using the internet
Studying at university
Offices personnel/human resources management

A collection of records or documents dealing with one


organization, person, area or subject in Manual
(paper) files or Computer files

Traditional file based system is basically a file based


system, in which we manually or through computer
handle the database such as updating, insertion ,
deletion adding new files to the database etc.

There are several advantages of file based system):


No need of external storage
No need of highly technical person to handle the database.

File based system also has some disadvantages:


Provide less security.
Redundancy is more

less integrity
high complexity in updating of database

DBMS is stands for Database Management System


which is a software that enables user to define, create,
maintain, and control access to database.
DBMS will interacts with the users application
programs and the database.

Application program is any computer program that interacts

with the database by issuing an appropriate request (typically


an SQL statement) to the DBMS

Example: MS Access, SQL, mySQL, Oracale, etc

Database System or database application is simply a


program that interacts with the database at some
points in its execution.
Database system is also a collection programs that
interact with the database along with the DBMS itself.

Online Public Access


Catalog (OPAC)

Travel Agency
(Online Booking)

Using the internet

GIVE OTHER EXAMPLES.

Database System, DBMS and Database overview

Examples of tables in database.

Self-Describing Nature of a Database System


The database system contains not only the

database itself but also a complete definition or


description of the database structure and
constraints.
This definition is stored in the system catalog,
which contains information such as the structure
of each file, the type and storage format of each
data item, and various constraints on the data.

Insulation between Programs and Data, and


Data Abstraction on the data.
In traditional file processing, the structure of data files

is embedded in the access programs, so any changes


to the structure of a file may require changing all
programs that access this file.
By contrast, DBMS access programs do not require
such changes in most cases.
The structure of data files is stored in the DBMS
catalog separately from the access programs. We call
this property program-data independence.

Support of Multiple Views of the Data


A database typically has many 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 but is not
explicitly stored.
A multiuser DBMS whose users have a variety of applications
must provide facilities for defining multiple views.
For example, one user of the student information database
may be interested only in the transcript of each student
while a second user, who is interested only in checking that
students have taken all the prerequisites of each course they
register for.

Sharing of Data and Multiuser Transaction Processing


A multiuser DBMS, as its name implies, must allow multiple users

to access the database at the same time.


This is essential if data for multiple applications is to be
integrated and maintained in a single database.
The DBMS must include concurrency control software to ensure
that several users trying to update the same data do so in a
controlled manner so that the result of the updates is correct.
For example, when several reservation clerks try to assign a seat
on an airline flight, the DBMS should ensure that each seat can be
accessed by only one clerk at a time for assignment to a
passenger.
These types of applications are generally called on-line
transaction processing (OLTP) applications. A fundamental role of
multiuser DBMS software is to ensure that concurrent
transactions operate correctly.

Data Independence
The data is held in such a way that changes to the structure of the
database do not effect any of the programs used to access the data.
Consistency of Data
Each item of data is held only once therefore no danger of item
being updated on one system and not on another.
Control Over Redundancy
In a non-database system, the same information may be held on
several files. This wastes space and makes updating more timeconsuming. A database system minimizes these effects.
Integrity of Data
The DBMS provides users with the ability to specify constraints on
data such as making a field entry essential or using a validation
routine.

Greater Security of Data


The DBMS can ensure only authorized users are allowed access to
the data.
Centralized Control of Data
The Database Administrator will control who has access to what
More Information Available to User
Users have access to a wider range of data that was previously
held in separate departments and sometimes on incompatible
systems.
Increased Productivity
The DBMS provides an easy to use query language that allows
users to get immediate response from their queries rather than
having to use a specialist "programmer" to write queries for them.

Larger Size
More disk space is required and probably a larger and

more powerful computer.

Greater Complexity
For optimum use the database must be very carefully

designed. If not done well, the new system may fail to


satisfy anyone.

Greater Impact of System Failure


"All eggs in one basket.

More Complex Recovery Procedures


If a system failure occurs it is vital that no data is lost.

Identify the general types of databases:

A.Personal
B.Workgroup
C.Department
D.Enterprise

An integrated collection of concepts for describing


and manipulating data, relationships between
data, and constraints on the data in organization.

a)Record base
b)Object base
c)Physical base

The database consists of a number of fixed


format records possibly of differing types.
Each record type defines a fixed number of
fields, each typically of a fixed length.
There are three types of record-based data
model :

Relational data model


ii. Networked data model
iii. Hierarchical data model
i.

In the relational model, data and relationships


are represented as tables
Each of which has a number of column with a
unique name.
Eg:

Data is represented as collection of records and


relationship by sets.
The records are organized as generalized graph
structures with records appearing as nodes (also
called segments) and sets as edges in the graph.
Eg:

Again, data is represented as collection of


records and relationship by sets.
However, hierarchical model allows a node to
have only one parent.
hierarchical model can be represented as a tree
graph, with records appearing as nodes and sets
as edges.
Eg:

Entity-Relationship
Semantic
Functional
Object-Oriented.

Entity-Relationship

Semantic
Sebenarnya hampir sama dengan ER MODEL, perbezaannya hanya terletak
pada pernyataan adanya relationship antara objeknya.
Jika pada ER MODEL menyatakan adanya relationship antara objek
menggunakan simbol-simbol namun pada SEMANTIC MODEL
menggunakan kata-kata. Berikut contoh dari SEMANTIC MODEL

Object-Oriented.

Physical data model represents how the model will be built


in the database.
A physical database model shows all table structures,
including column name, column data type, column
constraints, primary key, foreign key, and relationships
between tables.
Features of a physical data model include:

Specification all tables and columns.


Foreign keys are used to identify relationships between tables.

Denormalization may occur based on user requirements.


Physical considerations may cause the physical data model to be quite

different from the logical data model.

The figure below is an example of a physical data model.

a. Data Definition Language (DDL)


b. Data Manipulation Language (DML)
c. 4G Language (4GL)

The data definition language or sometimes called data


description language (DDL) is a collection of statements for the
description of data structure types.
The user must define a database structure in terms of these
data structure types.
A database structure defined by means of a DDL is called a
Data Base Schema or Conceptual Schema.
A data manipulation language (DML) is a collection of
operators or rules of inference which can be applied to any valid
instance of the data types listed in the database schema.

A database schema contains the description of all types


which are of interest to users.
A database itself contains instances of the previously
defined data types.
A combination of particular Data Manipulation and Data
Description Languages is called a Data Model.
Generally, the data model specifies rules according to which
data are structured and the associated operations that are
permitted. It may also be seen as a technique for the formal
description of data structures, usage constraints and
operations. The facilities available vary from one model to
another.

Often abbreviated 4GL, fourth-generation languages are


programming languages closer to human languages than typical
high-level programming languages.
Most 4GLs are used to access databases.
For example, a typical 4GL command is

FIND ALL RECORDS WHERE NAME IS "SMITH"

The other four generations of computer languages are


first generation: machine language
second generation: assembly language
third generation: high-level programming languages, such as C, C++, and Java.

fifth generation: languages used for artificial intelligence and neural networks.

To learn the DBMS in depth.

Functions of a DBMS

Data Storage, Retrieval, and Update.


A User-Accessible Catalog.
Transaction Support.
Concurrency Control Services.
Recovery Services.
Authorization Services.
Support for Data Communication.
Integrity Services.
Services to Promote Data Independence.
Utility Services.

To learn the DBMS in depth.

System Catalog :

Repository of information (metadata) describing the


data in the database.
One of the fundamental components of DBMS.
Typically stores:

names, types, and sizes of data items;


constraints on the data;
names of authorized users;
data items accessible by a user and the type of access;
usage statistics.
48

Hardware
Can range from a PC to a network of computers.

Software
DBMS, operating system, network software (if

necessary) and also the application programs.

Data
Used by the organization and a description of this

data called the schema.

Procedures
Instructions and rules that should be applied to the

design and use of the database and DBMS.

People

Data Administrator (DA)


Database Administrator (DBA)
Database Designers (Logical and Physical)
Application Programmers
End Users (naive and sophisticated)

First-generation
Hierarchical and Network

Second generation
Relational

Third generation
Object-Relational
Object-Oriented

Control of data redundancy


Data consistency
More information from the same amount
of data
Sharing of data
Improved data integrity
Improved security
Enforcement of standards
Economy of scale
Pearson Education Limited 1995, 2005

Balance conflicting requirements


Improved data accessibility and
responsiveness
Increased productivity
Improved maintenance through data
independence
Increased concurrency
Improved backup and recovery services
Pearson Education Limited 1995, 2005

Complexity
Size
Cost of DBMS
Additional hardware costs
Cost of conversion
Performance
Higher impact of a failure

56

57

Teleprocessing

File-server

Client-server

58

Traditional architecture.
Single mainframe with a number of
terminals attached.
Trend is now towards downsizing.

59

File-server is connected to several


workstations across a network.
Database resides on file-server.
DBMS and applications run on each
workstation.
Disadvantages include:
Significant network traffic.
Copy of DBMS on each workstation.
Concurrency, recovery and integrity control more

complex.

60

61

62

63

Advantages:
Thin client, requiring less expensive hardware.
Application maintenance centralized.

Easier to modify or replace one tier without

affecting others.
Separating business logic from database functions
makes it easier to implement load balancing.
Maps quite naturally to Web environment.

64

65

66

Program that controls data transfer


between clients and servers in order to
provide a consistent environment,
particularly for Online Transaction
Processing (OLTP).

67

DBMS
What?
How? (Advantages)
Architectures

Database
Language

Database System
What?
Where (Applications)
Who? (Roles)

File-Based
System

Data Model (3 types)

DATABASE

Differentiate
between Data Model
Schema and Data
Model Instances

Schema
-The description of the database.
-Include description of the database structure
and constraints that should hold on the
database.

Data
Model
Instances
- The actual data stored in a database at a

particular moment in time.


-Also called database state or occurrence

Schema
-Change very infrequently
-Schema is called intension

Data
Model
Instances
-Change every time the database is updated
-Instances is called extension

Lets do the GALLERY WALK together..

What? Gallery Walk?

Yup.. We show our findings together


and add up some more valuable info..

Ahaa, I got it.

So that we will understand more on this


chapter

DBMS
DATABASE SYSTEM
DATA MODEL
DATA MODEL SCHEMA vs DATA MODEL
INSTANCES
TERMS related to Database
Entities
Relationship
Constraints

Aggregate function is a function where the values


of multiple rows are grouped together as input on
certain criteria to form a single value
SQL aggregate functions return a single value,
calculated from values in a column.
Eg:

Average()
Count()
Maximum()
Median()
Minimum()
Mode()
Sum()

Vous aimerez peut-être aussi