Relational Algebra
Relational Algebra
12 Relational Model
Project
Union
Set different
Cartesian product
Rename
We will discuss all these operations in the
following sections.
Select Operation (o) - It selects tuples that satisfy the given
predicate from a relation.
Notation-or)
Where o stands for selection predicate and r stands for
formula which mayuse connectors like and, or, and not.relation.
p is prepositional logic
These terms may use relational
operators like - =,#,2,<, >, s.
For example,
Osubject "database"(Books)
Output -Selects tuples from books where subject is 'database!.
Osubject ="database"and price ="45so(Books)
Output -Selects tuples from books where subject is 'database' and 'price' is 450.
Osubject = "database" and price = "450" or year >"2010(Books)
Output -Selects tuples from books where subject is'database' and 'price' is 450 orthose
books published after 2010.
3.14 Relational Model
Project Operation (|) -It projects column(s) that satisfy a given predicate
Notation -IAl, A2, An (r)
Where Al, A2,An are attribute names of relationr.
kename Dperaton (p)- The reeills of relalional algetbra are also relations but without
Any n4ne The renAE opealion allows 46 l0 rename the Gulput relation,
'rename'
peation ia (denoted witlh annall (ireek letler tup,
Nitatlon p()
Where the Eul of expressn is haved witlh name of
341 ADDTONAL OPEMATO46
talended iferalon are those EaloR whnch can he derived fron basie operalurs.
Ihee afe nanly ihree lyes of Exended oEtalors in Melatnal Algebra.
DNT S6, ALL SOIS and tMI OYEE whieh are shewn in Table 1,
Tahle