Exercise #18 (tips and solutions) |
|||||||||||||||||||||||||||
In the following solution
Surely, joining on price might be replaced by simple comparison:
A mistake in the query is not related to said above, but to the fact that the solution determines ANY printers which have price coincident with a minimal price for color printers. Database includes corresponding items. As a result, we obtain
Meanwhile, correct answer gives only one row:
Second row is not related to color printer. You can be easyly convinced of it if you'll include additional columns in SELECT clause:
Second mistake is in possible duplicates, as a maker may have several printers having the same price. To return to discussion of exercise #18 |