Access over 20 million homework & study documents

Relation algebra

Content type
User Generated
Subject
Algebra
Type
Note
Rating
Showing Page:
1/12
Relation algebra
Relation algebra consists of a set of operations that take one or two relations as input and produce a
new relation as their results.
Relatin algebra is procedural language
Six basic operators
select:
project:
union:
set difference:
Cartesian product: x
rename:
Fundamental Relational
The select,project And rename operations are called unary operations,because they operate on one
relation.
The other set difference,Cartesian product,union are operate on pairs of relations and are therefore
called binary operations.
Unary Operations
The Select Operations
The select operations select tuples that satisfy a given predicate.
Select is denoted by lowercase Greek letter sigma( ),with the predicate appearing as a subscript
Notation-
p
(r)
Example-To select those tuples of the relation Employee whose city is ‘Mumbai’.
city=’Mumbai’
(Employee)
We combine several predicates into a larger predicates by using the connectives
(and),
(or),
(not)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/12
Example- To select those tuples of the relation Employee whose city is ‘Mumbai’ and empid is
10
city=’Mumbai’
empid=10
(Employee)
The Project Operations
The project operation is a unary operation that returns its argument relation,with certain attributes left
out.
Project is denoted by lowercase Greek letter pi()
We list those attributes that we wish to appear in the result as a subscript to
Notation-
attribute1,attribute2…attributen
(Relation)
Example-To list only empname and city from employee relation.
empname,city
(Employee)
The Rename operation
Relation operatioin allows us to refer to a relation by more than one name.
Rename is denoted by lowercase Greek letter rho(
)
Notation-
x
(R)
It gives new name to relation R as x.
Example-Give new name to Employee realtion to Emp.
Emp
(Employee)
Binary Operations
Union Operation

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/12

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 12 pages?
Access Now
Unformatted Attachment Preview
Relation algebra Relation algebra consists of a set of operations that take one or two relations as input and produce a new relation as their results. Relatin algebra is procedural language Six basic operators select: s project: Õ union: È set difference: – Cartesian product: x rename: r Fundamental Relational The select,project And rename operations are called unary operations,because they operate on one relation. The other set difference,Cartesian product,union are operate on pairs of relations and are therefore called binary operations. Unary Operations The Select Operations The select operations select tuples that satisfy a given predicate. Select is denoted by lowercase Greek letter sigma(s ),with the predicate appearing as a subscript Notation-s p(r) Example-To select those tuples of the relation Employee whose city is ‘Mumbai’. scity=’Mumbai’ (Employee) We combine several predicates into a larger predicates by using the connectives Ù (and), Ú (or), Ø (not) Example- To select those tuples of the relation Employee whose city is ‘Mumbai’ and empid is 10 scity=’Mumbai’ Ùempid=10 (Employee) The Project Operations The project operation is a unary operation that returns its argument relation,with certain attributes left out. Project is denoted by lowercase Greek letter pi(Õ) We list those attributes that we wish to appear in the result as a subscript to Õ Notation- Õattribute1,attribute2…attributen(Relation) Example-To list only ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Great! Studypool always delivers quality work.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4