Exercise #38 page 1
Find the countries having classes of both ordinary ships and cruisers.
That is, we should find the countries, which had the ships of the type "bc" and "bb". The words “that had ever owned”, to the author's opinion, must take into effect the following logical chain of discourses:
Conclusion: You should consider only the table “Classes” to solve this task. In the result we get quite a simple task. And I would not have written this explanation, if I had not been got suchlike underwritten solutions with the request to explain the reason why the system does not accept them. There is a solution:
Which statement this solution corresponds to? Find the countries that have the ships of the both types in the DB? If the answer is “yes”, then this solution will be not correct all the way.
In the first join query the countries, which have the ships of the both types in the table Ships, are determined. In the second query the countries, which have the ship of one type in the table Ships, and in the table Outcomes – the other one, are determined.