Am I right with my supertype/subtype tables creation
hi there,
i have subtype/supertype relationship with a disjoint rule and
partial specialisation
---table supertype
create table gift(
gift_id number,
constraint pk_gift primary key (gift_id));
---table subtypes
create table stock(
gift_id number not null,
no_of_shares number,
curr_price number,
constraint pk_gift primary key (gift_id)),
constraint uk_gift unique (gift_id)delete cascade);
create table property(
gift_id number not null,
prop_address1 varchar2(5),
prop_address2 varchar2(15),
prop_address3 varchar2(20),
post_code varchar2(8)'
curr_prop_value number,
constraint pk_gift primary key (gift_id)),
constraint uk_gift unique (gift_id)delete cascade);
create table cash(
gift_id number not null,
amount number,
constraint pk_gift primary key (gift_id)),
constraint uk_gift unique (gift_id)delete cascade);
create table artwork(
gift_id number not null,
description varchar2(30),
artist varchar2(10),
curr_art_value number,
constraint pk_gift primary key (gift_id)),
constraint uk_gift unique (gift_id)delete cascade);
could you point out any mistakes in terms of unique constraints
and gift_id appearing as inherited by the subclasses from the
superclass. Notice gift_id is inherited by the sub classes as
primary key and not foreign key.
Are there other ways of doing this assuming i am wrong?
Much appreciation.
Ayo