Database Reference
In-Depth Information
CUSTOMER Relation
SUPPLIER Relation
CustomerNo
1000
1010
1050
1100
1120
CustomerName
Country
SupplierNo
200
205
300
SupplierName
Herman Electricals
Allied Electrics, Ltd.
Akiro & Amana
SupCountry
U.S.A.
U.K.
Japan
Rosato Electric
MDZ Electric
Electric des Royal
Mitshista Electric
Jean Pierre
U.S.A.
U.K.
France
Japan
France
PRODUCT Relation
SALE Relation
ProductCode
4136
5555
5678
6543
ProdDesc
Three-way switch
Circuit breaker
Junction box
5HP Motor
SupplierNo
205
200
300
300
Date
5-Mar
7-Mar
9-Mar
13-Mar
7-Mar
15-Mar
29-Mar
CustomerNo
1000
1010
1050
1100
1120
1000
1100
ProductCode
4136
5555
5678
6543
5555
4163
6543
SalespersID
15
21
23
27
35
38
23
SALESPERSON Relation
SalespersID
15
21
23
27
35
38
42
SalesperName
Peterson
Espinoza
James
Warren
Rolland
SupvrID
42
38
42
38
38
OfficeCity
Boston
Trenton
Boston
Toronto
Montreal
Quebec
Boston
Demetrius
McPherson
Figure 8-18
Sample relations to illustrate solutions.
Target list. List of attributes to be included in the solution relation.
Row variable. A letter to indicate a variable quantity that represents the quali-
fying rows.
Qualifying statement. The part of the relational calculus solution that contains
conditions for qualifying rows.
Separator. The indicator “:” separating the target list of attributes to be present
in the solution relation from the rest of the relational calculus statement.
Comparison of Generic Languages
Let us conclude our discussion of the two powerful generic languages proposed by
Dr. Codd with a comparison between them.
Comparison of Solutions Let us go over a few examples of relational algebra
and relational calculus solutions. Use the relations presented in Figure 8-18.
Data request What are the names of the customers in France? Mark the result
relation as CUSTFRANCE
Relational algebra solution
A :
=
SELECT (CUSTOMER: Country
=
'France')
CUSTFRANCE :
A [ CustomerName ]
Relational calculus solution
CUSTFRANCE
{r.CustomerName : r in CUSTOMER and r.Country = 'France'}
=
Search WWH ::




Custom Search