loading..
Русский    English
01:35

Exercise #23 page 1

Find the makers producing at least both a pc having speed not less than 750 MHz and a laptop having speed not less than 750 MHz. Result set: Maker

Query below includes typical mistake peculiar to beginners which solve this exercise.

Solution 1.15.1

Console
Execute
  1. SELECT DISTINCT maker
  2. FROM product
  3. WHERE model IN (SELECT model
  4. FROM PC
  5. WHERE speed >= 750
  6. ) OR
  7. model IN (SELECT model
  8. FROM Laptop
  9. WHERE speed >= 750
  10. );

The mistake lies in the fact that the result set will include a producer which manufactures something one: either PC or laptops, because the predicate in WHERE clause will be true if at least one of two conditions linked with OR operator will be satisfied. This doesn't match the task and is fairly discarded by a system.

T&S

To solve the problem on SQL-EX.RU

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