create table item_avail
(
pro_id int primary key,
mod_id int,
color varchar(10)
);
create table Laptop
(
pro_id int primary key,
mod_id varchar(5) not null check (mod_id like "L%"),
color varchar2(10),
comp_name varchar2(20),
RAM number(5),
spaceHD number(4),
foreign key (pro_id, mod_id, color) references item_avail (pro_id, mod_id, color)
);
create table Handycam
(
pro_id int primary key,
mod_id varchar(5) not null check (mod_id like "H%"),
color varchar2(10),
comp_name varchar2(20),
zoomX number,
foreign key (pro_id, mod_id, color) references item_avail (pro_id, mod_id, color)
);
create table Mobile
(
pro_id int primary key,
mod_id varchar(5) not null check (mod_id like "M%"),
color varchar2(10),
comp_name varchar2(20),
camerapixel integer,
foreign key (pro_id, mod_id, color) references item_avail (pro_id, mod_id, color)
);
I have tried inheritance.......
Superclass : item_avail
Subclasses : Laptop, Mobile, Handycam
While running I face errors due to 'check' constraint...
Is there any better way of doing it..????
Please help...ASAP
:-/
:?: