Understanding SQL & Java Together: A Guide to SQLJ, JDBC, and Related Technologies

Significantly, structured types can participate in type hierarchies; that is, an SQL structured type can be a subtype of another structured type, called its supertype. Although many readers of this book (after all, many of you are Java programmers or otherwise familiar with Java) already understand type hierarchies, we'll take a few minutes to outline the meaning and importance of the concept. If you're already familiar with the idea, feel free to take a short break we'll try to be done with this section before you get back.
A type hierarchy in SQL is a collection of user-defined types, some of which are "specializations" of other types. Again, this may best be illustrated by example. In our music and video store example, we need to model a number of real-life objects, such as music (CDs, cassettes, vinyl LPs, and MiniDiscs) and movies. Movies are available as VHS tapes, laserdiscs, and DVDs, which now come with Dolby Digital 5.1 sound (sometimes called AC-3) and DTS 5.1 sound. (However, we have chosen not to stock Divx products!) In designing our applications and database, we observed that all of the movie formats we handle have a lot in common but a few differences as well. For example, all movie formats include the title of the movie, the description, the studio, the director, the producer, and so forth. However, VHS tapes and DVDs have different stock numbers and quite often have different contents...