Introduction To Database System
Introduction To Database System
DATABASE
SEMESTER 2/2014/2015
23 February - 4 June 2015
LE
UR
T
C
DITP 1333
AGENDA: WEEK 1
Database
Introduction
Database
Environment
ANSI-SPARC Architecture
Data Model and Conceptual Modeling
Functions of DBMS
Database
Introduction
DBMS
Advantages &
Disadvantages
Roles in
DB
Environment
DBMS
History
Introduction
Database concept has been
UNIVERSITY
Introduction
Database
Introduction
Digital Data
Digitaldataarestoredincomputersasfiles.Often,dataare
arrayedintabularform.Forthisreason,datafilesareoften
calledtables.
Adatabaseisacollectionoftables.
Businessesandgovernmentagenciesthatservelarge
clienteles,suchastelecommunicationscompanies,airlines,
creditcardfirms,andbanks,relyonextensivedatabasesfor
theirbilling,payroll,inventory,andmarketingoperations.
Databasemanagementsystemsareinformationsystemsthat
peopleusetostore,update,andanalyzenongeographic
databases.
Introduction
Database
Introduction
Information vs Data
Information can
be
defined
as
data
that
has
been
processed UNIVERSITY
and are useful
information
Employees
Students
Courses
name
address
Data referred to staff number
data
TOUR AGENT
CLINIC
Employees
Holiday Packages
Booking
Employees
Medicine
Patients
Package name
Package price
name
address
allergies
Introduction
Database
Introduction
For example the list below will be useless because we do not know
what the purpose of the data collected. Assumptions can be made
to the existing data, but it does not make the information we have is
accurate and relevant.
Groceries
499
400
99
School
200
200
Medical
900
35
865
(b) Summarized
data
Real World
Entity
UNIVERSITY
Environment
STUDENT
File
Attribute Name
Name
Record
Attribute Value
Address
Age
Faculty
Department
1 Mariam
Perak
23
FTMK
SE
2 Zulaikha
Johor
24
FTMK
MM
3 Zaki
Selangor
22
FTMK
SE
4 Alif
Terengganu
23
FTMK
SE
Database
Introduction
vs Database Approach
File-based System is
a Collection of application programs that
perform services for the end-user such
as the production of reports. Each
program defines and manages its own
data.
Database
Introduction
Student application
program
Course application
program
Each
Finance application
program
Student File
student name,
student address,
matrices number
Course File
course name, course
code,
Finance File
customer number,
customer name
Database
Introduction
vs Database Approach
FILE-BASED SYSTEM
DATABASE APPROACH
SYSTEM
Database
Introduction
Limitation
of file-based systems
DATA
DEPENDENCE
SEPARATION
OF DATA
L
B
I
T
A
P
M
INCO
E
L
I
F
S
E
T
A
M
FOR
FIX
QU ED
AP ERI
N PLIC S OF
AT
PR
IO
OG
RA
MS
REDU
NDAN
Y
C
DUPL
IC
OF DA ATION
TA
Database
Database
Introduction
database is a
large repository of data
Database
Introduction
Database
Components
Address
Age
Faculty
Enroll Date
Perak
23
FTMK
1/9/2014
2 Zulaikha Johor
24
FTMK
1/9/2014
1 D123
3 Zaki
Selangor
22
FTMK
1/9/2014
4 Aliff
Terengganu 23
FTMK
1/9/2014
1 Mariam
Data Type
Size
Name
VARCHAR
23
Address
VARCHAR
24
Age
NUMBER
22
Faculty
VARCHAR
23
Enroll Date
DATE
Matric No Name
Address
Age
Enroll Date
Mariam
Perak
23
1/9/2014
2 D213
Zulaikha
Johor
24
1/9/2014
3 D312
Zaki
Selangor
22
1/9/2014
4 D411
Aliff
Terengganu
23
1/9/2014
Database
Introduction
ROLES
in Db environment
supervises
writes and
enforces
procedures
and standards
DATABASE
ADMINISTRATOR
ANALYST
SYSTEM
ADMINISTRATOR
manages
designs
END USERS
use
DB DESIGNER
PROGRAMMERS
DBMS utilities
DBMS
write
application
programs
hardware
access
DATA
Database
Introduction
DBMS
Database
Introduction
DBMS
History
Revolution began
Database
Introduction
DBMS
History
File-based system
Adequate for small applications
Drawbacks
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.
Database Approach
Arose because:
Definition of data was embedded in
application programs, rather than being stored
separately and independently.
No control over access and manipulation of
data beyond that imposed by application
programs.
Duplication of data
Result:
Same data is held by different locations.
The database and Database Management
Wasted space and potentially different values and/or System (DBMS).
different formats for the same item.
Data dependence
File structure is defined in the program code.
Incompatible file formats
Programs are written in different languages, and so
cannot easily access each others files.
Fixed Queries/Proliferation of application programs
Programs are written to satisfy particular functions.
Any new requirement needs a new program.
Database
Introduction
DBMS
History
Eachnewapproachtodatabasedesignrequiredthe
useofincreasinglypowerfulcomputerstoachieve
satisfactoryperformanceforlargevolumesofdata.
MODULARITY CONTROL
Fully
modular
Object-Oriented
emergedasanewsolutiontoproblemsraisedby
bothhierarchicalandnetworkdesigns
Relational
Network
wasdevelopedasaresponsetothe
limitationsofhierarchicaldesigns
Hierarchical
Fully
integrated
istoovercometheshortcomingsof
fileorientedsystems
File- oriented
1950
1960
1970
TIME
1980
1990
Database
Introduction
DBMS
History
File- oriented
SALES REP
ALI
SALES REP
AMINAH
ACC STAFF
CHONG
INVOICE SYSTEM
ORDER SYSTEM
CUSTOMER
MASTER FILE
INVENTORY
MASTER FILE
ACC STAFF
AHMAD
BACK
ORDER FILE
INVENTORY
PRICING
FILE
CUSTOMER
RECEIPT FILE
Database
Introduction
DBMS
Hierarchical Database
ORDER
SYSTEM
Customer
Number
(b)
Order(s)
Figure 1
product price
(a)
Name &
Address
Product
Number
Backorder(s
)
product price
SYSTEM
Example:
A hierarchical database is designed
for rapid searches of orders by
customer number. Each customer
number is linked to a customer name
and address and one or more orders.
By searching to find what orders are
associated with a customer number,
sales representatives can find what
products are included in any order,
and search the database separately
to find which orders are backordered.
Accounting staff can accumulate
order quantities and prices by
customer
number
to
generate
Database
Introduction
DBMS
Network Database
Customer
Number
ORDER
SYSTEM
Product
Number
Name &
Address
Order(s)
product price
(a)
Backorder(s
)
product price
Figure 2
explicit
pathway
Database
Introduction
DBMS
Relational Database
CUSTOMER TABLE
PRODUCT TABLE
Cust #
Cust_Nam
e
Prod #
Prod_Nam
e
100
Ali
10
Mini Ipad
200
Aminah
20
Iphone 6
300
Ahmad
30
laptop
ORDER TABLE
Cust #
Prod #
300
20
100
30
PRICE TABLE
Prod #
Prod_Nam
e
10
RM 1000
20
RM 2800
30
RM 3900
BACKORDER TABLE
Prod #
Date
30
June 2014
Database
Introduction
DBMS
RESULT
Prod #
Cust #
Price
30
100
laptop
RM 3900
Ali
June 2014
Database
Introduction
DBMS
Object-Oriented
Inheritance
OBJECT
Attribute
Attribute
Att Value
Att Value
INHERITANCE
Specialization
SPECIALIZATION
CUSTOMER
ADDRESS
Attribute
Attribute
Att Value
Att Value
ALI
Street
Location Code
SG Address
Address
Credit limit
Melaka
RM 1000
Street
Zip Code
MY Address
Street
Postal Code
Database
Introduction
TYPES
of Database
Database
Introduction
TYPES
of Database
NUMBER OF USERS
DATABASE TYPE
DESCRIPTION
Single-user
Desktop
Multi-user
Workgroup
Enterprise
Database
Introduction
TYPES
of Database
LOCATION
Database
Introduction
TYPES
of Database
USE
Data warehouse:
Stores data used to generate information required to make tactical or
strategic decisions
Often used to store historical data
Structure is quite different
16
Database
Introduction
DBMS
Software
INGRESS
INFORMIX
SYBASE
MY SQL
ORACLE
MICROSOFT
ACCESS
MICROSOFT
SQL SERVER
Database
Introduction
DBMS
why?
Databasemanagementsystemsarevaluablebecausethey
providesecuremeansofstoringandupdatingdata.
Databaseadministratorscanprotectfilessothatonlyauthorized
userscanmakechanges.
DBMSprovidetransactionmanagementfunctionsthatallow
multipleuserstoeditthedatabasesimultaneously.
Inaddition,DBMSalsoprovidesophisticatedmeanstoretrieve
datathatmeetuserspecifiedcriteria.Inotherwords,theyenable
userstoselectdatainresponsetoparticularquestions.A
questionthatisaddressedtoadatabasethroughaDBMSis
calledaquery.
Database
Introduction
DBMS
Advantages
Disadvantages
ANSI-SPARC
Architecture
Database
Environment
Data Model
and
Conceptual
Design
Function
of DBMS
Database
Environment
ANSI-SPARC consists
ARCHITECTURE
of
three
levels.
External Level
View 1
View 2
mapping
Conceptual Level
mapping
Internal/Physical Level
DATABASE
View 3
proposed by the
Standard
Planning
and
Requirements
Comittess of the
American
Standards
Institute Comittee
on Computers and
Information
Processing (ANSI /
40
SPARC).
Database
Environment
ANSI-SPARC
ARCHITECTURE
Database
Environment
ANSI-SPARC
ARCHITECTURE
External Level
Conceptual
Level
Internal/Physi
cal Level
View 1
View 2
CUSTOMER TABLE
Cust #
Cust_Name
100
Ali
Designers View
CUSTOMER TABLE
Cust #
Cust_Nam
e
Cust_Salar
Cust_B.O.D
y
100
Ali
1000
2 JUNE 1981
CUSTOMER TABLE
Cust #
Cust_Name
Cust_Salary
Cust_B.O.D
100
Ali
1000
2 JUNE 1981
CREATETABLECUSTOMER
(
cust_novarchar(12),
cust_namevarchar(20),
cust_salarynumber,
cust_dobdate)
);
Database
Environment
Database System
Components
Database system is composed of five main parts:
1.
Hardware
2.
Software
Operating system software
DBMS software
Application programs and utility software
3.
People
4.
Procedures
5.
Data
40
Database
Environment
Data Model
Database
Environment
Data Model
a
simple
Data Modelling is :
representations
of
complex real-world data
structures
(Often
graphical)
a model: an abstraction
of a real-world object
or event
Useful in understanding
complexities of the realworld environment
is
iterative
and
progressive
Facilitate
interaction
among
the
designer,
applications programmer,
and end user
End users have different
views and needs for data
Data model organizes data
for various users
Database
Environment
Data Model
ENTITY
ATTRIBUTE
RE
T
A
L
IP
H
S
N
IO
CONSTRAINT
Model
Building
Blocks
Database
Environment
Data Model
Business Rules
Database
Environment
Data Model
Database
Environment
Data Model
Conceptual Modelling
Represents global view of the entire database
All external views integrated into single global view: conceptual
schema
ER model most widely used
ERD graphically represents the conceptual schema
Provides a relatively easily understood macro level view of data
environment
Independent of both software and hardware
Does not depend on the DBMS software used to implement the
model
Does not depend on the hardware used in the implementation of
the model
Changes in hardware or software do not affect database design
at the conceptual level
Database
Environment
Data Model
Business Rules
Conceptual Modelling
Enrollment
must
have
one
Database
Environment
DBMS
Functions
44
SUMMARY
Data are raw facts. Information is the result
of processing data to reveal its meaning.
To implement and manage a database, use
a DBMS.
Database design defines the database
structure.
A well-designed database facilitates data
management and generates accurate and
valuable information.
A poorly designed database can lead to bad
decision making, and bad decision making
can lead to the failure of an organization.
50
SUMMARY
Databases were preceded by file systems.
Limitations of file system data management:
requires extensive programming
system administration complex and difficult
making changes to existing structures is difficult
security features are likely to be inadequate
independent files tend to contain redundant data
DBMSs were developed to address file systems
inherent weaknesses
51