Reputation: 529
Problem:
Consider a relation of scheme Building(Street, Number, No.Apartments, Color, Age).
TRC: find the oldest building in Downing Street.
The associated SQL statement would be:
SELECT MAX(Age) AS ‘Oldest building’, Street FROM Building WHERE Street = ‘Downing Street’;
My answer using TRC: (B stands for Building relation)
{V.*|V(B) | V.BAge >=Age ^ V.Bstreet = ‘Downing Street’}
V.*
(it returns evry single tuple of Building)
V(B)
(it maps variables V to Building’s tuples)
V.BAge >=Age ^ V.Bstreet = ‘Downing Street’
(here I set the condition…maybe..)
Upvotes: -1
Views: 395
Reputation: 3577
If this is still relevant: the hint would be to realize that the oldest building is the one such that no other building is older than it.
Upvotes: 1