drop table component cascade constraints;
create table component (
part1	varchar2(20),
part2	varchar2(20),
amount	number(7),
attr	char(1));

drop table price cascade constraints;
create table price (
part	varchar2(20),
price	number(7));

insert into component values('engine', 'sparkplug', 4, 'b');
insert into component values('engine', 'cylinder', 4, 'c');
insert into component values('engine', 'valve', 4, 'c');
insert into component values('engine', 'crankshaft', 1, 'c');
insert into component values('cylinder', 'piston', 1, 'c');
insert into component values('cylinder', 'connectinggrod', 1, 'c');
insert into component values('valve', 'gasket', 1, 'b');
insert into component values('valve', 'hanger', 2, 'c');
insert into component values('crankshaft', 'joint', 8, 'c');
insert into component values('piston', 'screw', 2, 'b');

insert into component values('piston', 'gasket', 3, 'b');
insert into component values('connectinggrod', 'screw', 4, 'b');
insert into component values('connectinggrod', 'bolt', 4, 'b');
insert into component values('hanger', 'screw', 4, 'b');
insert into component values('hanger', 'bolt', 2, 'b');
insert into component values('joint', 'screw', 10, 'b');
insert into component values('joint', 'sj1', 20, 'c');
insert into component values('sj1', 'sj2', 20, 'c');
insert into component values('sj2', 'sj3', 20, 'c');
insert into component values('sj3', 'bolt', 20, 'b');

insert into component values('engine', 'se1', 10, 'c');
insert into component values('se1', 'se2', 10, 'c');
insert into component values('se2', 'se3', 10, 'c');
insert into component values('se3', 'se4', 10, 'c');
insert into component values('se4', 'se5', 10, 'c');
insert into component values('se5', 'screw', 10, 'b');

insert into component values('cylinder', 'sc1', 1, 'c');
insert into component values('sc1', 'sc2', 1, 'c');
insert into component values('sc2', 'sc3', 1, 'c');
insert into component values('sc3', 'sc4', 1, 'c');
insert into component values('sc4', 'sc5', 1, 'c');
insert into component values('sc5', 'screw', 1, 'b');

insert into component values('piston', 'sp1', 1, 'c');
insert into component values('sp1', 'sp2', 1, 'c');
insert into component values('sp2', 'sp3', 1, 'c');
insert into component values('sp3', 'sp4', 1, 'c');
insert into component values('sp4', 'sp5', 1, 'c');
insert into component values('sp5', 'screw', 1, 'b');

insert into component values('valve', 'sv1', 1, 'c');
insert into component values('sv1', 'sv2', 1, 'c');
insert into component values('sv2', 'sv3', 1, 'c');
insert into component values('sv3', 'sv4', 1, 'c');
insert into component values('sv4', 'sv5', 1, 'c');
insert into component values('sv5', 'screw', 1, 'b');

insert into price values ('sparkplug', 10);
insert into price values ('screw', 2);
insert into price values ('gasket', 3);
insert into price values ('bolt', 2);