Download presentation
Presentation is loading. Please wait.
Published byἩρώδης Αλεξιάδης Modified over 6 years ago
1
Data Base System Lecture 9: Rational Algebra and Relational Calculus
By: Nur Uddin, Ph.D
2
What will we learn? The meaning of the term “relational completeness.”
How to form queries in the relational algebra. How to form queries in the tuple relational calculus. How to form queries in the domain relational calculus. The categories of relational Data Manipulation Languages (DMLs).
3
Motivation We concentrate on the relational algebra and the relational calculus as defined by Codd (1971) as the basis for relational languages. We may describe the relational algebra as a (high-level) procedural language: it can be used to tell the DBMS how to build a new relation from one or more relations in the database. We may describe the relational calculus as a nonprocedural language: it can be used to formulate the definition of a relation in terms of one or more database relations.
4
Motivation (cont’d) Both the algebra and the calculus are formal, non-user-friendly languages. They have been used as the basis for other, higher-level Data Manipulation Languages (DMLs) for relational databases.
5
The Relational Algebra
The relational algebra is a theoretical language with operations that work on one or more relations to define another relation without changing the original relation(s). The five fundamental operations in relational algebra Selection Projection Cartesian product Union Set difference
6
Unary and binary operations
The Selection and Projection operations are unary operations, as they operate on one relation. The other operations work on pairs of relations and are therefore called binary operations.
7
Unary operations: selection and projection
8
Relation: Staff
9
Selection
10
Projection
11
Binary operation Union Set difference Intersection Cartesian product.
12
Union
13
Set difference
14
Intersection
15
Cartesian product
16
Cartesian product
17
Cartesian product
18
The relational calculus
The relational calculus is not related to differential and integral calculus in mathematics, but takes its name from a branch of symbolic logic called predicate calculus. When applied to databases, it is found in two forms: tuple relational calculus, as originally proposed by Codd (1972a), and domain relational calculus, as proposed by Lacroix and Pirotte (1977). The relational calculus is related to discrete mathematics.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.