Question
Exercise 6.4. 7: Write the following queries, based on the database schema Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, launched) Battles(name, date) Outcomes(ship, battle,
Exercise 6.4. 7: Write the following queries, based on the database schema
Classes(class, type, country, numGuns, bore, displacement)
Ships(name, class, launched)
Battles(name, date)
Outcomes(ship, battle, result)
a) Find the number of battleship classes.
b) Find the average number of guns of battleship classes.
! c) Find the average number of guns of battleships. Note the difference between
(b) and (c); do we weight a class by the number of ships of that
class or not?
! d) Find for each class the year in which the first ship of that class was
launched.
! e) Find for each class the number of ships of that class sunk in battle.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started