Question: Create SQL queries to answer the following questions: The database schema is as follows: Ships(name, class, launched) Classes(class, type, country, numGuns, bore, displacement): 'bb' for

Create SQL queries to answer the following questions:

The database schema is as follows:

Ships(name, class, launched)

Classes(class, type, country, numGuns, bore, displacement): 'bb' for battleship and 'bc' for battlecruiser.

Battles(name, date)

Outcomes(ship, battle, result)

Question 1.

List, for each country, the average number of guns carried by their battleships.

Question 2.

List all the pairs of countries that fought each other in battles. List each pair only once, and list them with the country that comes first in alphabetical order first.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!