Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
relational algebra

relational algebra

Ratings: (0)|Views: 49|Likes:
Published by ali khan

More info:

Published by: ali khan on Aug 01, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

02/01/2013

pdf

text

original

UNIT-2
Relational Algebra:-

The relational algebra is procedural query language . It
consists of a set of operations that take one or two relation as input and
produce a new relation as their result. The fundamental operations in the
relational algebra are select,project,Union, set difference,Cartesian product
and Rename.In addition to the fundamental operations there are several
other operations namely set intersection,natural join, division and
assignment. These operations will be defined in term of the fundamental
operations.

Fundamental operations:-

Select, project and rename operation are called unary
operations because the operate on one relation. The other three operations
operate on pair of relations are therefore called binary operations.

Select operation:-

Select operation selects tuples that satisfy a given predicate.we use the
greek letter sigma(σ) to denote selection. The predicate appears as a
subscript to σ. The argument relation is given in parenthescs following the
σ.thus ,to select those tuples of the loan relation where the branch is “SBI
DB Road”.

σbranch_name=”SBI DB Road”^Amount>1200(loan)
Branch_name
Loan_number
Amount
SBI DB Road
L-15
1500
SBI DB Road
L-20
1700
SBI DB Road
L-17
2000
In genral we allow comparisons using =,!=,<,<=,>,>= in the selection
predicate.
Project operation:-

The project operation allows us to produce this relation. the
project operation is unary operation that returns its argument relation.
projection is denoted by the greek letter pi(π). we list those attributes that
we wish to appear in the result as a subscript to π. The argument relation
follow in parantheses. Thus the query to list all loan numbers and amount of
loan can be written as

πLoan_number,Amount(Loan)
Result:-
Loan_numb
er
Amoun
t
L-10
1000
L-15
1500
L-20
1700
L-17
2000
Composition of Relational operations:-

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->