Consider two relation instances below, with the following schemas: Country(count
ID: 3669190 • Letter: C
Question
Consider two relation instances below, with the following schemas:
Country(country_name, continent); [country_name should be underlined as a key]
City(city_name, country_name, is_capital, population); [city_name & country_name should be underlined]
Write a relational algebra expression and show its result when the expression is executed with the given instances:
(a) List the names of all European cities with population of more than 600,000.
(b) List the names of all countries for which no cities have been entered into the City table.
(c) List names and continents of countries that are either in Europe or whose capitals have a population of over 1 million.
Explanation / Answer
a)
city_name((contentinent= 'europe'(country)(population > 600000)(city))
city_name(contentinent= 'europe' and population > 600000 (country)(city))
city_name
berlin
hambury
paris
lyon
-----------------------------------------------------------------------------------------------------------------------------------------------
b)
country_name(country)country_name(city)
country_name
england
---------------------------------------------------------------------------------------------------------------------------------------------
c)
continent='europe'(country)U country.country_name,country.continent(((is_capital='yes' and population>1000000(city))country)
country_name
england
germang
france
mali
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.