3. RELATIONAL CALCULUS
Relational calculus is a non-procedural
query language.
In the non-procedural query language,
the user is concerned with the details of
how to obtain the end results.
The relational calculus tells what to do
but never explains how to do.
4. TUPLE RELATIONAL CALCULUS
It is a non-procedural query language
which is based on finding a number of
tuple variables also known as range
variable for which predicate holds true.
It describes the desired information
without giving a specific procedure for
obtaining that information.
The tuple relational calculus is specified
to select the tuples in a relation.
In TRC, filtering variable uses the tuples
of a relation.
The result of the relation can have one or
more tuples.
5. Find the loan number, branch, amount of loans of
greater than or equal to 10000 amount.
{t| t ∈ loan ∧ t[amount]>=10000}
Loan number Branch name Amount
L33 ABC 10000
L35 DEF 15000
L49 GHI 9000
L98 DEF 65000
7. Find the loan number for each loan of an amount
greater or equal to 10000.
{t| ∃ s ∈ loan(t[loan number] = s[loan number]
∧ s[amount]>=10000)}
Loan number Branch name Amount
L33 ABC 10000
L35 DEF 15000
L49 GHI 9000
L98 DEF 65000
Loan number
number
L33
L35
L98
8. SAFTEY OF EXPRESSION - THE
CONCEPT OF DOMAIN
A tuple relational calculus may generate an
infinite relation. For example:
{t | (t∈loan)}
There are infinitely many tuples that are
not in loan.
To address this issue, we use the concept of
domain of tuple relational formula, P.
The Domain of P,denoted dom(P), is a set of
all values referenced by P. These include
values mentioned in P itself, as well as the
values that appear in a tuple of a relation
mentioned in P.
For example: dom(t∈loan ^ t[anount]>1200) is
the set containing 1200 and all the values
present in the loan.
9. FORMAL DEFINITION
As shown earlier, a tuple relational calculus
expression is
of the form
{t | P(t)}
Where P is a formula.
• A formula may contain several tuple variables.
• A tuple variable is said to be a free variable unless
it is
quantified by a 3(there exists) or Ö(for all).
Tuple variables that are quantified by 3 or I are
called
bound variables.
• For ex, in the expression:
t€ loan ^ 3 s € customer(t[branch - name] =
s[branch - name])
t is a free variable and s is a bound variable.
10. TUPLE VS DOMAIN RELATIONAL CALCULUS
TUPLE RELATIONAL CALCULUS
• The Tuple Relational Calculus (TRC) is
used to select tuples from a relation.
• The tuples with specific range values,
tuples with certain attribute values, and
so on can be selected.
• In TRC, the variables represent the
tuples from specified relations.
• A tuple is a single element of relation.
In database terms, it is a row.
• {T | EMPLOYEE (T) AND T.DEPT_ID =
10}
DOMAIN RELATIONAL
CALCULUS
• The Domain Relational Calculus
(DRC) employs a list of attributes from
which to choose based on the
condition.
• Based on the condition. It’s similar to
TRC, but instead of selecting entire
tuples, it selects attributes.
• In DRC, the variables represent the
value drawn from a specified domain.
• A domain is equivalent to column data
type and any constraints on the value
of data.
• It is more similar to logic as a modeling
language.
10
11. THANK YOU
36 Pranav Menon
37 Khushi Mevada
38 Sahil Panchbhaiya
39 Subhamsekhar Panda
40 Hrishikesh Parkar