-1

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..)

SQB
  • 3,926
  • 2
  • 28
  • 49
9628001
  • 509
  • 1
  • 4
  • 11

1 Answers1

1

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.

Alexander Serebrenik
  • 3,567
  • 2
  • 16
  • 32