CREATE TYPE Tname AS OBJECT (firstName VARCHAR2(30), lastName VARCHAR2(30)); / CREATE TYPE Taddress AS OBJECT (street VARCHAR2(30), streetNumber CHAR(5), city VARCHAR2(20), zip CHAR(4), country VARCHAR2(20)); / CREATE TYPE TTelephones AS VARRAY(6) OF VARCHAR2(15); / CREATE TYPE TPerson AS OBJECT (SSN CHAR(9), name Tname, birthDate Date, address Taddress, telephones TTelephones) NOT FINAL; / CREATE TYPE TCourse; / CREATE TYPE TCourseTaken; / CREATE TYPE TFaculty; / CREATE TYPE Tdiploma AS OBJECT (name VARCHAR2(15), year CHAR(4)); / CREATE TYPE Tdiplomas AS VARRAY(10) OF Tdiploma; / CREATE TYPE TSetRefCourses AS TABLE OF REF TCourse; / CREATE TYPE TSetRefCourseTaken AS TABLE OF REF TCourseTaken; / CREATE TYPE TStudent UNDER TPerson (studentNo CHAR(6), department VARCHAR2(20), diplomas Tdiplomas, courseEnrolledRefs TSetRefCourses, courseTakenRefs TSetRefCourseTaken); / CREATE TYPE TSetRefStudents AS TABLE OF REF TStudent; / CREATE OR REPLACE TYPE TCourse AS OBJECT (courseNo CHAR(10), courseName VARCHAR2(40), credits INTEGER, year INTEGER, department VARCHAR2(20), courseTakenRefs TSetRefCourseTaken, enrolledStudentRefs TSetRefStudents, professorRef REF TFaculty); / CREATE OR REPLACE TYPE TCourseTaken AS OBJECT (grades Decimal(2,2), year CHAR(4), studentRef REF TStudent, courseRef REF TCourse); / CREATE TYPE TbankAccount AS OBJECT (accountNumber VARCHAR2(20), bank VARCHAR2(20)); / CREATE OR REPLACE TYPE TFaculty UNDER TPerson (empNo CHAR(10), bankAccount TbankAccount, coursesTaughtRefs TSetRefCourses); / CREATE TABLE Person OF TPerson(Primary Key (SSN)); / CREATE TABLE Faculty OF TFaculty NESTED TABLE coursesTaughtRefs STORE AS coursesTaughtRefs_tab; / CREATE TABLE Student of TStudent NESTED TABLE courseEnrolledRefs STORE AS courseEnrolledRefs_tab NESTED TABLE courseTakenRefs STORE AS courseTakenRefs1_tab;