loading..
Русский    English
16:10

Exercise #46 page 3

In conclusion, I adduce one more solution with such mistake, but without using outer joins.

Solution 3.1.3

Console
Execute
  1. SELECT a.ship, b.displacement, b.numguns
  2. FROM Outcomes a, Ships c, Classes b
  3. WHERE a.battle='Guadalcanal' AND
  4. a.ship = c.name AND
  5. c.class = b.class
  6. UNION
  7. SELECT a.ship, NULL AS displacement, NULL AS numguns
  8. FROM Outcomes a
  9. WHERE a.battle = 'Guadalcanal' AND
  10. a.ship NOT IN (SELECT name
  11. FROM Ships
  12. );

Let`s note that the first offered solution would return right result for such lead ship. That`s why that to solve this task we need to append the first solution to the second. The ways how should not to "append" solution, you can see in the Chapter four.

T&S

To solve the problem on SQL-EX.RU

Bookmark and Share
Pages 1 2 3
The book was updated
several days ago
©SQL-EX,2008 [Evolution] [Feedback] [About] [Links] [Team]
All right reserved.
Rambler's Top100