Guide IV
Chapter 5 Relational Algebra and Relational Calculus
5.1 Choose any four relational algebra operators and explain how each functions.
For example: Select produces a horizontal subset of a relation. Project produces a vertical subset
5.2 Given two relations R and S, where R contains N1 tuples and S contains N2 tuples (N2 > N1 > 0),
give the minimum and maximum cardinality for the result relation for each of the following
relational algebra expressions and in each case state any assumptions about the schemas that are
required to make the expression meaningful:
(a) R S
(b) R S
(c) R S
(d) R x S
(e) a = 1(R)
(f) a(R)
Answer is shown in table below.
Expression Min Max Assumptions
5.3 A relational database contains details about journeys from Paisley to a variety of destinations and
contains the following relations:
Operator (opCode, opName)
Journey (opCode, destinationCode, price)
Destination (destinationCode, destinationName, distance)
Each operator is assigned a unique code (opCode) and the relation operator records the
association between this code and the operator s name (opName). Each destination has a unique
code (destinationCode) and the relation destination records the association between this code
and the destination name (destinationName), and the distance of the destination from Paisley.