Find street number of the longest street in each city in Canada

Relevant relations:

City(city-name,country-name,area,population) Street(stno,city-name,length)

The keys are bolded

My tuple relational calculus set is defined:

 {l.stno | STREET(l) and forAll c (CITY(c) and c.country-name = "Canada") -> doesn't Exist s (STREET(s) and s.city-name=c.city-name and s.length > l.length)}

I think this searches for the 1 longest street from all Canadian cities instead. How can I make this correct?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.