Which of the following delete statements all of the cities in the country "Spain" from the city table?

Note: The countrycode field in the city table references the Code field in the country table.
Which of the following delete statements all of the cities in the country “Spain” from the city table?

Note: The countrycode field in the city table references the Code field in the country table.
Which of the following delete statements all of the cities in the country “Spain” from the city table?

A.
DELETE City FROM Country JOIN City
ON Country.Code=City.CountryCode WHERE Country.Name = ‘Spain’

B.
DELETE FROM City
USING Country, City
WHERE Country.Code=City.CountryCode

C.
DELETE FROM City USING Country JOIN City
ON Country.Code=City.CountryCode WHERE Country.Name=’Spain’

D.
DELETE FROM City USING Country
WHERE Country.Code=City.CountryCode AND Country.Name=’Spain’

Explanation:
Top3 are ok as all specify which tables to be deleted from (city), note join condition ON/WHERE co.Code = ci.CountryCode and WHERE co.Name = Spain.
— D doesn’t join the tables so the statement doesn’t work.



Leave a Reply 0

Your email address will not be published. Required fields are marked *