Question: Write the following as assertions. The database schema is from the battleships Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, launched) Battles(name, date) Outcomes(ship, battle,
Write the following as assertions. The database schema is from the battleships
Classes(class, type, country, numGuns, bore, displacement)
Ships(name, class, launched)
Battles(name, date)
Outcomes(ship, battle, result)
a) No class may have more than 2 ships.
b) No country may have both battleships and battlecruisers.
c) No ship with more than 9 guns may be in a battle with a ship having fewer than 9 guns that was sunk.
d) No ship may be launched before the ship that bears the name of the first ships class.
e) For every class, there is a ship with the name of that class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
