Exercise: 38

Find countries that ever had classes of both battleships (‘bb’) and cruisers (‘bc’).

Solution

SELECT country
FROM classes
WHERE type = 'bc'
INTERSECT
SELECT country
FROM classes
WHERE type = 'bb'

References