Main page

Typical errors at solution of exercises. Exercise 55

S. Moiseenko

For each class, define the year in which the first ship of this class was launched.
Result set : class , year.

There should be used NULL-value, if launching year for ships of present class is unknown, because the task says: for each class. However, the distinctive mistake in solving this task doesn't lie in this. The question is that there may be a class in the database, but not any ships of this class. It completely satisfies the constraints of Ships scheme, namely, one-to-many relationship between the tables Classes and Ships. Naturally, in this case NULL-value in launching year should be written, as we don't know it.

Given examples here can be done directly on the website by selecting the check box Without checking on the page with SELECT exercises.

Main page

Usage of any materials of this site is possible
only under condition of mandatory allocation of the direct link to a site
on each page where used materials are placed.

 Main   Articles    Books Rambler's Top100 Alt   SQL: , ,    SQL Copyright c 2002-2006. All rights reserved.