SQL3 (Cont.)


Subtables (Cont.)
A row identifier may be used either implicitly for identification or explicitly, for example as a foreign-key value. Row identifiers are specific data types with system-wide values.

(A subtable example) A table may be declared as a subtable of other tables:

1CREATE TABLE employee UNDER person (
2  qualification  VARCHAR(10),
3  salary         INT,
4  familymembers  SET( person IDENTITY ) );

The following rules are applied for using subtable and row identifiers: Show the names of all persons living in Boston:

1SELECT name FROM person WHERE domicile.city = 'Boston';

Show those employees whose family members include a person named “Peter Smith:”

1SELECT * FROM employee a WHERE 'Peter Smith' IN
2  ( SELECT b.name FROM ( a.familymembers ) b );




      Two fishes are in a tank.    
      One turns to the other and says...    
      How do you drive this thing?