Database Reference
In-Depth Information
SALESPERSON Relation
SalespersID
15
21
23
27
35
38
42
SalesperName
Peterson
Espinoza
James
Warren
Rolland
Demetrius
McPherson
SupvrID
42
38
42
38
38
OfficeCity
Boston
Trenton
Boston
Toronto
Montreal
Quebec
Boston
target list
separator
qualifying statement
{ r. SalesperName : r in SALESPERSON and r.OfficeCity = 'Boston' }
row variable
Figure 8-17
Relational calculus statement.
Let us take an example. Refer to Figure 8-17.
Data request
What are the names of the salespersons attached to the Boston
office?
We mentioned that relational calculus provides single solution statements. First, let
us try to write the solution statement in plain English.
Solution to contain
SalesperName
from rows in SALESPERSON relation,
only from certain rows from SALESPERSON relation,
a row in SALESPERSON to qualify to be part of the solution
it must satisfy the condition that
OfficeCity from that row must be Boston.
A relational calculus solution statement is similar to this plain English statement.
Instead of expressing the solution in a long-winding way as the above statement,
relational calculus statement is more succinct and standardized. See the solution
example shown below and also as explained in Figure 8-17.
Relational calculus solution
{ r.SalesperName : r IN SALESPERSON AND r.OfficeCity = 'Boston' }
In the figure, the components of the relational calculus statement are pointed
out. Note the descriptions of the components as shown below:
Search WWH ::




Custom Search