Monday, August 14, 2006

Creation of Subtype in Post Gress
create type custype as object
(
customer_id number(10),
customer_name varchar2(20),
customer_sex varchar2(10),
customer_adress varchar2(20),
customer_rented_item varchar2(20),
customer_overdue_item varchar2(10),
customer_phone_No number(10),
customer_account_info varchar2(10)
);
/
--------------------------------------------
create type copytype as object
(
copy_id number(10),
number_of_copies number(10),
number_of_rented_copies number(10),
number_of_remaining_copy number(10)
);
/
-----------------------------------------------
----------------------------------------------
create type itemtype as object
(
item_id number(10),
item_name varchar2(20),
item_purchase_date date,
item_price varchar2(10),
item_loan_type number(10),
copy_id REF copytype
);
/
-----------------------------------------------
create type Booktype as object
(
Book_id number(10),
book_author_name varchar2(20),
book_published_year date,
item_id REF itemtype
);
/
----------------------------------------------
create type loantype as object
(
loan_id number(10),
loan_day number(10),
loan_date date,
due_date date,
return_date date,
customer_id REF custype,
item_id REF itemtype
);
/

--------------------------------------------------
create type cdvdtype as object
(
cdvd_id number(10),
cdvd_manfc_name varchar2(20),
cdvd_release_year Date,
item_id REF itemtype
);

0 comments: