-- What countries do we know of as having classes of ships?
-- For each one, give the range and average number of guns for
-- that country's classes, as well as the number of classes.
select c.country, min(c.numGuns), max(c.numGuns), avg(c.numGuns), count(*)
from Classes c
group  by c.country;

-- What classes are there for which we know of at least 4 ships?
-- For each, give the class and the number of ships.
select s.class, count(*)
from Ships s
group by s.class
having count(*)>=4;

-- What classes are there for which we know of at least 4 ships
-- that were launched after 1900? For each, give the class and
-- number of ships. The list should be in decreasing order of
-- number of ships; within any given number, the list should be
-- alphabetical by the name of the class.
select s.class, count(*) as ships
from Ships s
where s.launched > 1900
group by s.class
having ships >= 4
order by ships desc, s.class;
