SQL> CREATE OR REPLACE TYPE bookType AS OBJECT
2 (book_id VARCHAR2(10),
3 book_title VARCHAR2(30))
4 /
Type created.
SQL>
SQL> CREATE OR REPLACE TYPE authorType AS OBJECT
2 (author_id VARCHAR2(10),
3 author_name VARCHAR2(30))
4 /
Type created.
SQL>
SQL> CREATE TABLE Book OF bookType
2 (book_id NOT NULL,
3 PRIMARY KEY (book_id));
Table created.
SQL>
SQL> CREATE TABLE Author OF authorType
2 (author_id NOT NULL,
3 PRIMARY KEY (author_id));
Table created.
SQL>
SQL> CREATE TABLE Write
2 (Book REF bookType,
3 Index_Book NUMBER NOT NULL,
4 Author REF authorType);
Table created.
SQL>
SQL> CREATE TABLE Written_By
2 (Author REF authorType,
3 Index_Author NUMBER NOT NULL,
4 Book REF bookType);
Table created.
SQL>
SQL>
SQL> drop type bookType force;
Type dropped.
SQL> drop type authorType force;
Type dropped.
SQL>
SQL>
SQL> drop table Book;
Table dropped.
SQL> drop table Author;
Table dropped.
SQL> drop table Write;
Table dropped.
SQL> drop table Written_By;
Table dropped.
|