loading..
Русский    English
00:09

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
Tags
aggregate functions Airport ALL AND AS keyword ASCII AVG Battles Bezhaev Bismarck C.J.Date calculated columns Cartesian product CASE cast CHAR CHARINDEX Chebykin check constraint classes COALESCE common table expressions comparison predicates Computer firm CONSTRAINT CONVERT correlated subqueries COUNT CROSS APPLY CTE data type conversion data types database schema DATEADD DATEDIFF DATENAME DATEPART DATETIME date_time functions DDL DEFAULT DEFAULT VALUES DELETE DISTINCT DML duplicates edge equi-join EXCEPT exercise (-2) More tags
The book was updated
several days ago
https://exchangesumo.com/obmen/BTC-RNKBRUB/
©SQL-EX,2008 [Evolution] [Feedback] [About] [Links] [Team]
All right reserved.
Rambler's Top100