0
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
:-/
:?:

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by debasisdas
0

I am using Oracle 10g. I don't know how to implementing inheritance. I even searched it on the net, but I did not get any thing.
I have a base table as 'items_available (product_id, model_id, color)'

The sub-tables are as follows...

laptop (product_id, model_id, memory, hardrive, company_name, price, color);
handycam (product_id, model_id, zoom, pixel, company_name, price, color);

Please help ASAP.......
thnx..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.