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