|
Notes > Database Systems > Relational Algebra, Calculus and Operators
|
Relational algebra and calculus forms the basis for relational languages. All the fundamental operations necessary within a Data Manipulation Language (DML) can be defined in relational algebra and calculus.
To grasp an understanding of the difference between relational algebra and calculus, relational algebra can be viewed as procedural and relational calculus, non-procedural. Relational algebra specifies how to get the required information and how to build a relation from one or more other relations. Relational calculus simply provides a definition of a relation in terms of one or more other relations. In other words, it says what data is required, but not how it is actually retrieved. Every algebraic expression has an equivalent calculus expression and vice versa.
The concept of closure relates to relational algebra. Closure means that relational expressions can be nested within each other. For example, an operation which leads to a new relation as its output can be put within brackets and used within another expression. The relations are closed under the relational algebra.
E. F. Codd (1972) proposed 8 operations used within relational algebra. The 5 fundamental operators are listed below:
- Selection - Projection - Cartesian Product - Union - Set Difference
The other 3 operators can be defined using these fundamental operators and are shown below:
- Join - Intersection - Division
Selection Conditions
A conditional statement can take the following forms:
<attribute name> <comparison operator> <constant value> or <attribute name> <comparison operator> <attribute name>
The <comparison operator> shown above can be any of the following comparison operators:
= (equals) ≠(does not equal) < (smaller than) > (larger than) ≤ (smaller than or equal to) ≥ (larger than or equal to)
The Boolean operators AND, OR, and NOT can also be used to connect / combine these selection conditions.
Search for "Relational Algebra, Calculus and Operators" on:
Google |
Kelkoo |
Amazon |
eBay (UK) |
eBay (US)
Search for "Relational Algebra, Calculus and Operators" on the rest of Computing Students: Relational Algebra, Calculus and Operators
|
|
|