|
Featured Papers from Direct Essays
|
|
|
|
|
|
This is a preview of a paper to view the full text you need to signup and login.
|
Relational Algebra
|
|
|
... )
- A query language is a language in which a user requests information from the database
- The formal languages: Relational algebra and Relational Calculus
- The commercial languages: SQL and QBE
Formal language Commercial (Informal) language
DML Procedural
(Relational Algebra) SQL (Structured Query Language)
Non-procedural
(Relational calculus) QBE (Query by Example)
Relational Algebra
- The relational algebra consists of a collection of high-level operators that operate on relations
- Codd defined a very specific set of eight such operators, two groups of four each
• The traditional set operation: Union, Intersection, Difference, and Cartesian Product
• The special relational operation: Restrict (or Select), Project, Join, and Divide
- Each such operator takes either one (Restrict and Project ) or two relations (the rest of eight) as its input and produces a new relation as its output
- Union Compatibility
• Two relations are union-compatible if and only if they have identical headings - meaning, precisely, that:
1) They have the same set of attribute name (note, therefore, that they must have a fortiori have the same degree)
2) Corresponding attributes (i. ... Depart_ID > DEPARTMENT
Division (R1 R2)
- Takes two relations, one binary and one unary, and builds a relation consisting of all values of one attribute of the binary relation that match (in the other attribute) all values in the unary relations
A
S# P#
S1 P1
S1 P2
S1 P3
S1 P4
S1 P5
S1 P6
S2 P1
S2 P2
S3 P2
S4 P2
S4 P4
S4 P5
B
P#
P2
P4
C A B
Closure
- The output from each of the operations is another relation
- Because the output of any operation is the same kind of object as the input, so the output from one operations can become input to another
- In other words, it is possible to write nested relational expression
Relational Calculus
- The relational algebra and the relational calculus are alternative candidates as a forma basis for the manipulative part of the relational model
- The difference is as follows: where the relational algebra provides a collection of explicit operations that can actually be used to tell the system how to build some desired relation from the given relations in the database, the calculus merely provides a notation for formulating the definition of that desired relation in terms of those given relations
Codd’s Equivalence Theorem
- Everything that can be retrieved using the Algebra can also be retrieved using the Calculus, and vice versa
- The algebra and the calculus are precisely equivalent to one another.
|
|
|
To link to this page, copy the following code to your site:
|
|
Paper Information
|
|
|
Title: Relational Algebra
Words: 1076 Rating: None Pages: 4.3 submitted by: rwalls
If you think this paper shouldn't be here then
|
|
|
|
|
Signup & Login
|
|
|
If you don't currently have a login then Signup here
|
|
|
|
|
Pre-Written Papers
|
|
|
|
|
|
|
|
Custom Papers
|
|
|
|
|
|
|
|