1

I am working on the following exercise:

Using tuple relational calculus, find names of persons who own at least one house in each city in Canada.

The relevant relation schemas are:

  • City (city-name, country-name, area, population)

  • House (hno,#rooms, stno, owner-name)

  • Street (stno, city-name, length)

Note: Bolded are keys.

This is what I came up with:

{ h.owner-name | House(h) and forAll c (City(c) and c.name="Canada") -> 
(Exists s(Street(s) and s.city-name = c.name) and Exists x(House(x) and x.stno = s.stno and x.owner-name = h.owner-name) ) }

How I read this aloud:

  • "For all Canadian cities, there exists a street with a HOUSE x that has the same owner as the HOUSE h."

Is this correct? I've peen pulling my hair out trying to understand tuple relational calculus.

MDCCL
  • 8,530
  • 3
  • 32
  • 63
Mandy
  • 11
  • 1

0 Answers0