CREATE TYPE Member_Type AS OBJECT
 (Country VARCHAR2(4),
  Type VARCHAR2(30));
/
CREATE TYPE Member_List_Type AS
 TABLE OF Member_Type;
/
CREATE OR REPLACE TYPE Organization_Type AS OBJECT
 ( Name VARCHAR2(80),
    Abbrev VARCHAR2(12),
    Members Member_List_Type,
    Established DATE,
    has_hq_in REF City_Type,
    MEMBER FUNCTION is_member (the_country IN VARCHAR2)
    RETURN VARCHAR2,
    MEMBER FUNCTION people RETURN NUMBER,
    MEMBER FUNCTION number_of_members RETURN NUMBER,
    MEMBER PROCEDURE add_member
      (the_country IN VARCHAR2, the_type IN VARCHAR2),
    PRAGMA RESTRICT_REFERENCES (is_member, WNPS, WNDS),
    PRAGMA RESTRICT_REFERENCES (people, WNDS, WNPS),
    PRAGMA RESTRICT_REFERENCES (number_of_members, WNDS, WNPS));
/
