Exercise #151 page 2 |
||
Solution 3.5.2
The solution 3.5.2 takes into account:
It should be noted, that possible duplicates are eliminated by uniting by means of UNION. Last variant considers also those cases when the head ship took part in battles only after 1941 as earlier battles are considered by the previous inquiry. It remains to find out what it is necessary for. The answer on this question could be found in the “hung” head ships. So, a ship from Outcomes with the name matched with one of the classes ` name (head ship) is absent from the Ships table or it is present there but with unknown launching year. Let us assume that there is another ship with the same class and known launching year in the Ships table. If this year is an earlier one than 1941, then the head ship is necessary to be included into the result set with the mentioned ship. This follows the fact that the head ship is the first ship in its class. Therefore, it should be launched not later than launch year of any other ship of the class. |