Constraints on Relations
On March 21, 2014, In Relational Algebra by Admin
Views (1634)
Relational algebra offers a means to express common constraints, such as the referential integrity constraints introduced in "The Modeling of Constraints". Actually, we shall see that relational algebra provides us convenient ways to express a large variety of other constraints. Even functional dependencies can be expressed in relational algebra, as we shall see in "Additional Constraint Examples" Example 1. Constraints are very important in database programming, and we shall cover in "Multimedia Networking" how SQL database systems can enforce the same types of constraints as we can express in relational algebra.
Relational Algebra as a Constraint Language
There are two ways in which we can use expressions of relational algebra to express constraints.1. If R is an expression of relational algebra, then
2. If R and S are expressions of relational algebra, then
These ways of expressing constraints are in fact equivalent in what they can express, but sometimes one or the other is clearer or more brief. That is, the constraint
However, a constraint of the first form,
In the next sections, we shall see how to express important constraints in one of these two styles. As we shall see in "Multimedia Networking", it is the first style - equal-to-the-emptyset - that is most frequently used in SQL programming. On the other hand, as shown above, we are free to think in terms of set-containment if we wish and later convert our constraint to the equal-to-the-emptyset style.
Tags
- relational algebra
- functional dependencies
- database programming
- tuple
- Queries in PSM
- Using Shared Variables
- System Aspects of SQL
- Instead-Of Triggers
- Constraints on Attributes and Tuples
- Deferring the Checking of Constraints
- Maintaining Referential Integrity
- Declaring Foreign-Key Constraints
- Interpreting Queries Involving Views
- Full-Relation Operations
- Natural Joins / Outerjoins
- Subqueries in FROM Clauses
- Correlated Subqueries
- Conditions Involving Tuples
- Subqueries
- Union, Intersection, and Difference of Queries
- Interpreting Multirelation Queries
- Queries Involving More Than One Relation
- The Truth-Value UNKNOWN
- Selection in SQL
- The Database Language SQL
- Additional Constraint Examples
- Referential Integrity Constraints
- Extending the Projection Operator
- Extended Operators of Relational Algebra
- Selection on Bags / Product of Bags / Joins of Bags
- Relational Operations on Bags
- A Linear Notation for Algebraic Expressions
- Dependent and Independent Operations
- Renaming
- Combining Operations to Form Queries
- Natural Joins / Theta-Joins
- Set Operations on Relations
- An Algebra of Relational Operations
- Relational Algebra
- Object-Oriented Versus Object-Relational
- References
- Nested Relations
- Representing Set-Valued Attributes
- From ODL Designs to Relational Designs
- Reasoning About Multivalued Dependencies
- Roles in Relationships
- Instances of an E/R Diagram
- Database Programming
- The Query Processor