Sei sulla pagina 1di 15

Database Concepts

Database Concepts - 1
Application examples
o Supermarket
Database Concepts - 3
Database & Database Management System
Database
1= A shared collection of logically related
(and a description of this data), designed to
meet the information needs of an
organiation!
Database Management System (D"MS)
1= A soft#are system that enables
users to define, create, and maintain the
database and pro$ides controlled access
to this database!
Database Concepts - 2
Application examples
o Credit Card
Database Concepts - 4
CS3462 Introduction to Database
Systems Helena Wong, 2001
Application examples
o %ra$el Agent
Database Concepts - 5
Application examples
o &ni$ersity
Database Concepts - 7
Application examples
o 'ibrary
Database Concepts - 6
%raditional (ile)based *rocessing
Database Concepts - 8
CS3462 Introduction to Database
Systems Helena Wong, 2001
Database Approach
Arose because+
15 Definition of data #as embedded in
application programs, rather than being stored
separately and independently!
15 ,o control o$er access and manipulation
of data beyond that imposed by application
programs!
-esult ) the database and Database Management
System (D"MS)!
Database Concepts - 9
%he *aradigm Shift
(ile)based approach
%he #ork of database design #as dri$en by
the application needs of indi$idual
departments!
Database approach
%o think of the data first and then the
application second!
./ %he *aradigm Shift
Database Concepts - 11
D" and D"MS+ An example
Database Concepts - 10
Database
-ecall+ Database . A shared collection of
logically related data (and a description
of this data), designed to meet the
information needs of an organiation!
15 System catalog (data dictionary or
metadata) pro$ides the description of the
data to enable program0data independence!
15 'ogically related data comprises entities,
attributes, and relationships of an organiation1s
information!
Database Concepts - 12
CS3462 Introduction to Database Systems Helena Wong, 2001
'ogically -elated Data
entities, attributes, and relationships
Address
%el2,o
,ame
3#ner 3#ns
Entity
Attribute
Relationsip
(unctions of a D"MS
%he 'ost &pdate *roblem+
%ime %ransaction4
%ransaction5 balx
t4
t5 -ead(bal
t6 bal
t7 8rite(bal
t9
Database Concepts - 15
CS3462 Introduction to Database Systems
Helena Wong, 2001
(unctions of a D"MS
o Data storage, retrie$al, and update o &ser)
accessible catalog
o %ransaction support
Ensure that either all the updates corresponding to
a given transaction are made or that none of
them are made.
o Concurrency control ser$ices
Ensure that the database is updated correctly when
multiple users are updating the database
concurrently.
Database Concepts - 14
(unctions of a D"MS
o -eco$ery Ser$ices
o Authoriation Ser$ices
o Support for data
communication o
:ntegrity ser$ices
15 Ser$ices to promote data
independence
Programs can be writen
without knowing actual data
structure
15 &tility ser$ices
Eg. Import data from other formats,
monitor database usage and
operation, statistical kits, indexing,
garbage collection and reallocation.
Database Concepts - 16
Database 'anguages
-ecall+ D"MS . A soft#are system that
enables users to define, create, and
maintain the database and pro$ides
controlled access to this database!
Data definition language (DD')
%o express database schema (the structure of the
database)!
-esults ./ System Catalog
Data manipulation language (DM')
%o access and manipulate data!
Database Concepts - 17
Components of a D"MS
Database Concepts - 19
Database 'anguages
*rocedural & non)procedural DM's
*rocedural DM'
8hat data is needed and exactly how to retrie$e the
data!
,on)*rocedural DM'
8hat data is needed!
;g! Structured <uery 'anguage (S<')
Database Concepts - 18
Components of D"MS ;n$ironment
o =ard#are
o Soft#are
o Data
o *rocedures
o *eople
Database Concepts - 20
CS3462 Introduction to Database
Systems Helena Wong, 2001
D"MS ;n$ironment ) Hardware
;xample+
A %raditional
Architecture
(Dumb %erminals)
Database Concepts - 21
D"MS ;n$ironment ) Hardware
;xample+
A Client)
Ser$er
Architecture
Database Concepts - 23
D"MS ;n$ironment ) Hardware
;xample+
A (ile)
Ser$er
Architecture
Database Concepts - 22
D"MS ;n$ironment ) Software
15 D"MS > Application *rograms >
3perating Systems
15 A typical application program
embeds S<' statements in C or Cobol
codes to access data
15 D"MS %ools+ reports generators,
forms generators, application
generators etc!
Database Concepts - 24
CS3462 Introduction to Database
Systems Helena Wong, 2001
D"MS ;n$ironment ) Data
o Data (3perational data)
15 System Catalog
Examples:
ames, types, si!es of data items
"elationships
Integrity constraints on the data
ames of authori!ed users
#ypes of indexes and storage structures
$sage statistics
Database Concepts - 25
D"MS ;n$ironment ) People
o Data Administrator
%anagement of the data resource
o Database Administrators
"esponsible for physical aspects such as
physical database design and
implementation, security, performance
o Database Designer
o Application *rogrammers
o ;nd)&sers
Database Concepts - 27
D"MS ;n$ironment ) Procedures
*rocedures refer to the instructions and
rules of the design and use of the
database, eg!,
o 'ogon
o -un some programs
o Start and stop the
D"MS o "ackup
o (ailure handling
15 Changes on the data structures or
physical storage
Database Concepts
- 26
D" Architecture+ 6 'e$els of Abstraction
;xternal (&ser Views)
Each user concerns
with only his specific
portion of data
Conceptual ('ogical)
&hat data are stored
and the relationships
exist among data
:nternal (*hysical)
#he lowest level,
describes how data
are actually stored
Database Concepts - 28
CS3462 Introduction to Database
Systems Helena Wong, 2001
D" Architecture+ 6 'e$els of Abstraction
Database Concepts - 29
Data :ndependence
Database Concepts - 31
?ie# Mechanism
View mechanism
15 *ro$ides users #ith only the data they
#ant or need to use!
Ad$antages+
o *ro$ides a le$el of security
15 Allo#s to customie the appearance
of the database
15 *resents a consistent, unchanging
picture of the structure of the database
Database Concepts - 30
Data :ndependence
Data Independence + &pper le$els are unaffected by
changes to lo#er le$els!
*hysical Data :ndependence
15 the ability to modify the physical scheme
#ithout causing application programs to be
re#ritten
'ogical Data :ndependence
15 the ability to modify the conceptual scheme
#ithout causing application programs to be
re#ritten
Database Concepts - 32
CS3462 Introduction to Database
Systems Helena Wong, 2001
Data Models
Data Model . an integrated collection of concepts for
describing data, relationships and constraints on
the data in an organiation!
Database Design
%he process of database design in$ol$es 6 steps+
o Conceptual Database Design ./ Conceptual Model
Modelling of the information used in an enterprise,
independent of all physical considerations (the D"MS,
6 types of Data
Models+
-ecord)"ased Data
Models
1 -elational
(tables)
2 ,et#ork
(graphs)
3 =ierarchical
(trees)
3b@ect)"ased Data
Models
4 ;ntity)
-
e
l
a
t
i
o
n
s
h
i
p

5
3b
@ect)
3rien
ted

*hysical
Data
Models
(fe# in
use)
6 $
nifying
%odel'
(rame
memo
ry
application
programs and
languages,
hard#are
platform etc!)
15 'ogical
Database Design
./ 'ogical Model
-efine and map
the conceptual
model into a
logical model
according to the
target data model
fo
r
th
e
da
ta
ba
se (eg!
-elati
onal
data
model
)
15 *
hysical Database
Design./ =o# to
implement on
secondary
storage
(structures and
access methods)
Database
Concepts - 33
Do
nAt
be
con
fus
ed
Databa
se
Archite
cture (6
'e$els
of
abstrac
tion)+
E
x
t
e
r
n
a
l

)

*
o
n
c
e
p
t
u
a
l

)

I
n
t
e
r
n
a
l

+
P
h
y
s
i
c
a
l
,

-
e
v
e
l
s

E
x
t
e
r
n
a
l

)

*
o
n
c
e
p
t
u
a
l

)

I
n
t
e
r
n
a
l

.
c
h
e
m
a
s
D
a
t
a

:ndepe
ndence
+
-ogical
)
Physic
al /ata
Indepe
ndence
s
%ypes
of data
models
+
"ecord
0
1ased )
2b3ect0
1ased )
Physic
al /ata
%odels
Databa
se
Design
Steps+
4
*
o
n
c
e
p
t
u
a
l
/
a
t
a
b
a
s
e

/
e
s
i
g
n

5
6

*
o
n
c
e
p
t
u
a
l
%
o
d
e
l

4
-
o
g
i
c
a
l

/
a
t
a
b
a
s
e

/
e
s
i
g
n

5
6

-
o
g
i
c
a
l

%
o
d
e
l
4Physic
al
/ataba
se
/esign
56
Physic
al
implem
entatio
n plan
Database
Concepts - 35
Database
Concepts - 34
Ad$a
ntage
s of
D"M
S
o

S
h
a
r
i
n
g

o
f

D
a
t
a

(
&

D
a
t
a

A
c
c
e
s
s
)

o

C
o
n
t
r
o
l

o
f

-
e
d
u
n
d
a
n
c
y
o
Dat
a

C
o
n
s
i
s
t
e
n
c
y
o

:
m
p
r
o
$
e
d

D
a
t
a

S
t
a
n
d
a
r
d

o

"
e
t
t
e
r

D
a
t
a

S
e
c
u
r
i
t
y
o
=igher
Data
:ntegrit
y
o
"alanc
e of
Conflict
ing
-eBuire
ments
o

(
a
s
t
e
r

D
e
$
e
l
o
p
m
e
n
t

o
f

,
e
#

A
p
p
l
i
c
a
t
i
o
n
s

o

C
o
n
t
r
o
l

o
$
e
r

c
o
n
c
u
r
r
e
n
c
y
o "ackup
&
-eco$ery
Database
Concepts - 36
C
S
Introduct
ion to
Database
Systems
Helena
Wong, 2001
Disad$antages of D"MS
o =igh cost of D"MS
o May in$ol$e more expensi$e hard#are
o Specific programming skill
o Database files con$ersion
15 Slo#er processing of less
critical applications
15 :ncreased $ulnerability as
resources are centralied
15 More sophisticated reco$ery reBuired
#hen concurrent updates allo#ed
Database Concepts - 37
Case Study 0 Dream=ome ((orms)
Staff
Details
(orm
Database Concepts - 39
Case Study ) Dream=ome
3rganiation+
o "ranches
15 Staff of each branch+
2ne %anager
.upervisors
7089 :eneral .taff ; 8 secretary under
a supervisor
Database Concepts - 38
Case Study ) Dream=ome
Ser$ices pro$ided by Dream=ome+
o Ad$ertising the property ((lat or =ouse)
o :nter$ie# prospecti$e renters
o 3rganie $isits
o ,egotiate lease agreement
o :nspect the property regularly (C months)
Database Concepts - 40
CS3462 Introduction to Database
Systems Helena Wong, 2001
Case Study 0 Dream=ome ((orms)
(orms
used by
the Sales
Departmen
t
Database Concepts - 41
Case Study 0 Dream=ome (-eports)
*roperties for -ent -eport
Database Concepts - 43
Case Study 0 Dream=ome ((orms)
(orms
used by
the Sales
Departmen
t
Database Concepts - 42
Case Study 0 Dream=ome ((orms)
(orms
used by
the
Contracts
Departmen
t
Database Concepts - 44
CS3462 Introduction to Database Systems Helena Wong, 2001
Case Study 0 Dream=ome (-eports)
*roperty :nspection -eport
Database Concepts - 45
Case Study ) Dream=ome
%ransaction -eBuirements+
15 Maintain records of staff details, properties,
prospecti$e renters, $ie#ing by prospecti$e renters,
ad$erts, lease agreements, property inspections
o *roduce staff details listing at a branch
o *roduce listing of staff under a a super$isor
o *roduce listing of super$isors at a branch o
*roduce listing of properties at a branch
o *roduce listing of properties managed by a staff
Database Concepts - 47
Case Study ) Dream=ome
3ther data+
o Ad$ertisement details
o Appropriate ne#spapers
*olicies+
o -etain information of #ithdra#n properties+ 6 years
o -etain information of expired leases+ 6 years
o 'ease period+ 6 months 0 4 year
o ;ach staff manages not more than 4D properties
Database Concepts - 46
Case Study ) Dream=ome
o *roduce listing of prospecti$e renters at a branch
o Search for properties satisfying a prospecti$e renter
o *roduce a report of $ie#ing comments of a property
o *roduce listing of ad$erts for a property
o *roduce listing of ad$erts placed in a ne#spaper
o *roduce report of lease agreement for a property
o *roduce listing of inspections of a property
Database Concepts - 48
CS3462 Introduction to Database Systems Helena Wong, 2001

Potrebbero piacerti anche