next up previous
Next: Inheritance Up: Complex Types and Object Previous: Complex Types and Object

Structured and collection types

  1. Define a relation doc with complex attributes: sets and structured attributes.

    		 create type MyString char varying

    create type MyDate

    ( day integer,

    month char(10),

    year char(10))

    create type Document

    (name MyString,

    author-list setof(MyString),

    date MyDate,

    keyword-list setof(MyString))

    create table doc of type Document

  2. It allows type definition recorded in the schema stored in the database. One can also create table directly, without creating an intermediate type for the table.
  3. Complex type systems usually support other collection types, such as arrays and multisets, e.g.,

    		 author-array MyString[10] // presents an ordered list of authors.

    print-runs multiset(integer) // presents the number of copies in each printing run.

Osmar Zaiane
Tue Jul 7 15:03:55 PDT 1998