Professional Documents
Culture Documents
set union ( )
set difference(-) set operations
intersection ( )
Cartesian product ( x )
natural join ( )
division ( ) binary operation
Selection Operation
• When we want to get only some of the tuples
from a relation satisfying a given condition,
we can use this operation
Example for selection
s.no Sname Class Att.percentage
class=M.C.A (STUDENT)
1002 KRISHAN M.C.A 91
SUGUNA 100
PREETHI 91
Union operation
• It is denoted by
• Union of R and S is denoted by R S.
• Duplicate tuples are eliminated
• R and S must have same number of
attributes.
• It is the set of tuples with which are
either in R or in S or both
.
• R S NAME
KRISHNA
Set difference
• It is denoted by R-S.
• It is the set of tuples which are there in R but
not in S.
• R-S NAME
SUBHANI
SUGUNA
CARTESIAN PRODUCT
1004 SUBHANI 3
3 B.Tech
1005 SUGUNA 3
.
R <R.CLASSCODE=S.CLASSCODE> S
.
SNO SNAME CLASS CLASS
CODE NAME
1001 RAM 1 M.Tech
DDBMS
DDBMS
• In DDBMS, the database is stored on several
computers.
• The computers in a distributed system
communicate with one another through
various communication media such as
telephone lines.
• The computers in distributed system are
referred by sites or nodes.
Types of DDBMS
1. Homogeneous DDBMS
2. Heterogeneous DDBMS
Homogeneous DDBMS
In this, all sites have identical DBMS s/w
Window
Site 5 Unix
Oracle Site 1
Oracle
Window
Site 4 Communications
network
Oracle
Site 3 Site 2
Linux Oracle Linux Oracle
Heterogeneous DDBMS
In this, different sites may use different DBMS s/w
Network
Object DBMS
Oriented Site 3 Site 2 Relational
Linux Linux
Distributed data storage
• Consider a relation R that is to be stored in the
database.
• There are two approaches for storing this
relation in the DDBMS.
• These are
1. replication
2. fragmentation
Replication
• The system maintains several identical
replicas(copies) of the relation and stores each
replica at different site.
• If a relation R is replicated, a copy of relation R
is stored in two or more sites.
• In extreme case, a copy is stored in every site
in the system , which is called as full
replication
Advantage of replication
• Availability:
if one of the sites containing relation R fails,
then the relation R can be found in another
site. So the system can continue to process.
Disadvantage of replication
Increased overhead on update
Fragmentation
• The system partitions the relation into several
fragments and stores each fragment at a
different sites
• If relation R is fragmented, then R is divided
into a number of fragments r1,r2,…rn.
• These fragments contain sufficient
information to allow reconstruction of the
original relation R
Types of Fragmentation
1.Horizontal Fragmentation
2.Vertical Fragmentation
Horizontal fragmentation
• In horizontal fragmentation, a relation R is
partitioned into a number of subsets r1,r2,…r3.
• Each tuple of relation R must belong to at least
one of the fragments.
• In general, a horizontal fragment can be defined
as a selection on the global relation ‘R’.
• The predicate p is used to construct fragment ri
ri = p (R)
we reconstruct the relation ‘r’ by taking the union
of all fragments.
r1 r2 r3 ………. rn
Vertical fragmentation
In this , a relation R is split into number of
subsets of attributes.
here,
each vertical fragment ri is defined by
ri = Ri(r)
We reconstruct relation ‘R’ by taking the join
i.e.,
R= r1 r2 ……… rn
Advantages of DDBMS
1. Sharing data:
using distributed system, users at one site are
able to access the data residing at other site.
2. availability:
if one of the sites containing relation R fails,
then the relation R can be found in another
site. So the system can continue to process.
Disadvantage of DDBMS
• 1. s/w development cost.