CHAPTER 1 : INTRODUCTION
RELATIONAL CALCULUS
• It is a non-procedural query language. A calculus expression
specifies “What to retrieve” rather than “how to retrieve”.
• a query is solved by defining a solution relation in a single
step.
• it is mainly based on the well-known propositional calculus,
which is a method of calculating with sentences or
declatations.
QUANTIFIERS
UNIVERSAL EXISTENTIAL
QUANTIFIERS QUANTIFIERS
The universal quantifier The existential quantifier denoted
denoted by ∀ is read as for by ∃ is read as for all which means
all which means that in a that in a given set of tuples there is
given set of tuples exactly at least one occurrences whose
all tuples satisfy a given value satisfy a given condition.
condition.
RELATIONAL ALAGEBRA VS RELATIONAL
CALCULUS
• Relational Algebra is a • Relational Calculus is a
procedural language. non-procedural
• RA means “how to obtain language.
the result”. • RC means “What to
• The order is specified in obtain” as result.
which the operations • The order is not
have to be performed. specified.
Relational Calculus
Types of Relational Calculus
Tuple Relational Domain Relational
Model(TRC) Model(DRC)
Tuple Relational Calculus(TRC)
• The Tuple Relational Calculus i.e. TRC is based on specifying a number of
tuple variables.
• Each tuple variable usually ranges over a particular database relation i.e. the
variable may take as its value any individual tuple from that relation.
• A TRC query is of the form: {t|P(t)}
-Where
• t is a tuple variable.
• P(t) is a condition (Boolean) expression involving t that evaluates to
either TRUE or FALSE for different assignments of tuples to the
variable t.
-The result of such a query is the set of all tuples t that
evaluate P(t) to TRUE i.e. these tuples t satisfy the condition.