drop table bomComp cascade constraints; 
drop table bomPrice cascade constraints;

create table bomComp 
( 
  part     varchar2(20), 
  subPart  varchar2(20), 
  quantity number not null, 
  ptype     char check (ptype in ('c', 'b')), 
  primary key (part, subpart) 
); 

create table bomPrice 
( 
  part   varchar2(20) primary key, 
  bomPrice  number(6,2) not null 
); 

insert into bomComp values('a0001','a0002',2,'c');
insert into bomComp values('a0001','a0003',3,'c');
insert into bomComp values('a0001','a0004',2,'c');
insert into bomComp values('a0002','a0005',4,'c');
insert into bomComp values('a0002','a0006',3,'c');
insert into bomComp values('a0002','a0007',1,'c');
insert into bomComp values('a0002','a0008',2,'c');
insert into bomComp values('a0003','a0009',2,'c');
insert into bomComp values('a0003','a0010',3,'c');
insert into bomComp values('a0004','a0011',1,'c');
insert into bomComp values('a0004','a0012',2,'c');
insert into bomComp values('a0004','a0013',3,'c');
insert into bomComp values('a0005','a0014',2,'c');
insert into bomComp values('a0005','a0015',3,'c');
insert into bomComp values('a0005','a0016',1,'c');
insert into bomComp values('a0006','a0017',2,'c');
insert into bomComp values('a0006','a0018',1,'c');
insert into bomComp values('a0007','a0019',2,'c');
insert into bomComp values('a0008','a0020',2,'c');
insert into bomComp values('a0008','a0021',1,'c');
insert into bomComp values('a0009','a0022',2,'c');
insert into bomComp values('a0009','a0023',1,'c');
insert into bomComp values('a0010','a0024',2,'c');
insert into bomComp values('a0011','a0025',1,'c');
insert into bomComp values('a0011','a0026',2,'c');
insert into bomComp values('a0012','a0027',2,'c');
insert into bomComp values('a0013','a0028',1,'c');
insert into bomComp values('a0013','a0029',2,'c');
insert into bomComp values('a0014','a0030',2,'c');
insert into bomComp values('a0015','a0031',3,'c');
insert into bomComp values('a0016','a0032',2,'c');
insert into bomComp values('a0017','a0033',1,'c');
insert into bomComp values('a0018','a0034',2,'c');
insert into bomComp values('a0019','a0038',1,'b');
insert into bomComp values('a0020','a0035',1,'c');
insert into bomComp values('a0021','a0036',2,'c');
insert into bomComp values('a0022','a0030',1,'c');
insert into bomComp values('a0023','a0031',1,'c');
insert into bomComp values('a0024','a0033',1,'c');
insert into bomComp values('a0025','a0037',1,'c');
insert into bomComp values('a0026','a0034',1,'c');
insert into bomComp values('a0027','a0035',2,'c');
insert into bomComp values('a0028','a0032',1,'c');
insert into bomComp values('a0029','a0038',2,'b');
insert into bomComp values('a0030','a0038',2,'b');
insert into bomComp values('a0030','a0039',1,'c');
insert into bomComp values('a0031','a0040',1,'c');
insert into bomComp values('a0032','a0041',2,'c');
insert into bomComp values('a0033','a0042',1,'c');
insert into bomComp values('a0034','a0043',2,'b');
insert into bomComp values('a0035','a0044',1,'c');
insert into bomComp values('a0036','a0043',1,'b');
insert into bomComp values('a0037','a0039',2,'c');
insert into bomComp values('a0039','a0045',1,'c');
insert into bomComp values('a0040','a0046',1,'c');
insert into bomComp values('a0041','a0038',1,'b');
insert into bomComp values('a0042','a0047',2,'c');
insert into bomComp values('a0044','a0048',1,'c');
insert into bomComp values('a0045','a0049',1,'c');
insert into bomComp values('a0046','a0050',1,'c');
insert into bomComp values('a0047','a0051',1,'c');
insert into bomComp values('a0048','a0052',2,'b');
insert into bomComp values('a0049','a0053',2,'b');
insert into bomComp values('a0049','a0054',1,'c');
insert into bomComp values('a0050','a0055',2,'b');
insert into bomComp values('a0050','a0056',1,'c');
insert into bomComp values('a0051','a0057',1,'c');
insert into bomComp values('a0054','a0058',2,'b');
insert into bomComp values('a0054','a0059',2,'b');
insert into bomComp values('a0056','a0060',1,'c');
insert into bomComp values('a0057','a0061',1,'c');
insert into bomComp values('a0060','a0062',1,'c');
insert into bomComp values('a0061','a0063',1,'c');
insert into bomComp values('a0062','a0064',2,'b');
insert into bomComp values('a0062','a0065',1,'c');
insert into bomComp values('a0063','a0066',1,'c');
insert into bomComp values('a0063','a0067',2,'b');
insert into bomComp values('a0065','a0068',1,'c');
insert into bomComp values('a0066','a0069',1,'c');
insert into bomComp values('a0068','a0070',1,'c');
insert into bomComp values('a0068','a0071',1,'c');
insert into bomComp values('a0069','a0072',2,'c');
insert into bomComp values('a0069','a0073',3,'b');
insert into bomComp values('a0069','a0074',1,'b');
insert into bomComp values('a0070','a0075',1,'c');
insert into bomComp values('a0071','a0076',1,'c');
insert into bomComp values('a0072','a0077',1,'c');
insert into bomComp values('a0075','a0078',1,'c');
insert into bomComp values('a0075','a0079',1,'c');
insert into bomComp values('a0076','a0080',1,'c');
insert into bomComp values('a0076','a0081',2,'b');
insert into bomComp values('a0077','a0082',1,'c');
insert into bomComp values('a0078','a0083',1,'c');
insert into bomComp values('a0079','a0084',2,'c');
insert into bomComp values('a0080','a0085',1,'c');
insert into bomComp values('a0082','a0086',1,'c');
insert into bomComp values('a0082','a0087',2,'b');
insert into bomComp values('a0083','a0088',1,'c');
insert into bomComp values('a0084','a0089',2,'c');
insert into bomComp values('a0085','a0090',1,'c');
insert into bomComp values('a0086','a0091',2,'c');
insert into bomComp values('a0088','a0092',2,'c');
insert into bomComp values('a0089','a0093',1,'c');
insert into bomComp values('a0090','a0094',2,'c');
insert into bomComp values('a0091','a0095',2,'b');
insert into bomComp values('a0092','a0096',1,'c');
insert into bomComp values('a0093','a0097',2,'b');
insert into bomComp values('a0094','a0098',1,'c');
insert into bomComp values('a0096','a0099',1,'c');
insert into bomComp values('a0098','a0100',2,'c');
insert into bomComp values('a0099','a0101',1,'c');
insert into bomComp values('a0099','a0102',3,'b');
insert into bomComp values('a0100','a0103',2,'c');
insert into bomComp values('a0100','a0104',3,'b');
insert into bomComp values('a0101','a0105',1,'c');
insert into bomComp values('a0103','a0106',2,'c');
insert into bomComp values('a0105','a0107',2,'c');
insert into bomComp values('a0106','a0108',1,'c');
insert into bomComp values('a0107','a0109',1,'c');
insert into bomComp values('a0108','a0110',1,'c');
insert into bomComp values('a0109','a0111',1,'c');
insert into bomComp values('a0110','a0112',1,'c');
insert into bomComp values('a0111','a0113',2,'c');
insert into bomComp values('a0111','a0114',1,'b');
insert into bomComp values('a0111','a0115',2,'b');
insert into bomComp values('a0112','a0116',1,'c');
insert into bomComp values('a0113','a0117',1,'c');
insert into bomComp values('a0116','a0118',1,'c');
insert into bomComp values('a0117','a0119',2,'c');
insert into bomComp values('a0118','a0120',1,'c');
insert into bomComp values('a0119','a0121',1,'c');
insert into bomComp values('a0120','a0122',2,'b');
insert into bomComp values('a0120','a0123',1,'b');
insert into bomComp values('a0120','a0124',2,'b');
insert into bomComp values('a0121','a0125',2,'c');
insert into bomComp values('a0125','a0126',1,'c');
insert into bomComp values('a0126','a0127',2,'b');
insert into bomComp values('a0126','a0128',1,'b');
insert into bomComp values('a0126','a0129',1,'c');
insert into bomComp values('a0129','a0130',1,'c');
insert into bomComp values('a0130','a0131',2,'c');
insert into bomComp values('a0131','a0132',1,'c');
insert into bomComp values('a0131','a0133',2,'b');
insert into bomComp values('a0132','a0134',1,'c');
insert into bomComp values('a0134','a0135',2,'c');
insert into bomComp values('a0135','a0136',2,'c');
insert into bomComp values('a0136','a0137',2,'b');
insert into bomComp values('a0136','a0138',1,'c');
insert into bomComp values('a0136','a0139',2,'c');
insert into bomComp values('a0138','a0140',2,'c');
insert into bomComp values('a0139','a0141',1,'c');
insert into bomComp values('a0140','a0142',2,'c');
insert into bomComp values('a0141','a0143',2,'c');
insert into bomComp values('a0142','a0144',2,'c');
insert into bomComp values('a0143','a0145',1,'c');
insert into bomComp values('a0144','a0146',2,'b');
insert into bomComp values('a0144','a0147',2,'c');
insert into bomComp values('a0145','a0095',2,'b');
insert into bomComp values('a0145','a0087',3,'b');
insert into bomComp values('a0147','a0148',2,'c');
insert into bomComp values('a0148','a0149',2,'c');
insert into bomComp values('a0149','a0150',2,'c');
insert into bomComp values('a0150','a0151',3,'c');
insert into bomComp values('a0151','a0152',2,'c');
insert into bomComp values('a0152','a0153',1,'c');
insert into bomComp values('a0152','a0154',2,'b');
insert into bomComp values('a0153','a0155',2,'c');
insert into bomComp values('a0155','a0156',2,'c');
insert into bomComp values('a0156','a0157',2,'c');
insert into bomComp values('a0157','a0158',1,'c');
insert into bomComp values('a0157','a0159',3,'b');
insert into bomComp values('a0158','a0160',2,'c');
insert into bomComp values('a0160','a0161',2,'c');
insert into bomComp values('a0161','a0162',2,'c');
insert into bomComp values('a0162','a0163',2,'c');
insert into bomComp values('a0163','a0164',3,'c');
insert into bomComp values('a0164','a0165',2,'c');
insert into bomComp values('a0164','a0166',3,'b');
insert into bomComp values('a0164','a0167',2,'b');
insert into bomComp values('a0165','a0168',2,'c');
insert into bomComp values('a0168','a0169',2,'c');
insert into bomComp values('a0169','a0170',2,'c');
insert into bomComp values('a0170','a0171',2,'c');
insert into bomComp values('a0171','a0172',2,'b');
insert into bomComp values('a0171','a0102',3,'b');
insert into bomComp values('a0171','a0173',1,'c');
insert into bomComp values('a0173','a0174',2,'c');
insert into bomComp values('a0174','a0175',3,'c');
insert into bomComp values('a0175','a0176',2,'c');
insert into bomComp values('a0176','a0177',1,'c');
insert into bomComp values('a0176','a0178',2,'b');
insert into bomComp values('a0177','a0179',2,'c');
insert into bomComp values('a0179','a0180',2,'c');
insert into bomComp values('a0180','a0181',3,'c');
insert into bomComp values('a0181','a0182',2,'c');
insert into bomComp values('a0182','a0183',2,'c');
insert into bomComp values('a0183','a0184',2,'c');
insert into bomComp values('a0184','a0185',1,'c');
insert into bomComp values('a0184','a0186',2,'b');
insert into bomComp values('a0185','a0187',2,'c');
insert into bomComp values('a0187','a0188',2,'c');
insert into bomComp values('a0188','a0189',2,'c');
insert into bomComp values('a0189','a0190',2,'c');
insert into bomComp values('a0190','a0191',1,'c');
insert into bomComp values('a0190','a0122',3,'b');
insert into bomComp values('a0191','a0192',2,'c');
insert into bomComp values('a0192','a0193',2,'c');
insert into bomComp values('a0193','a0194',2,'c');
insert into bomComp values('a0194','a0195',2,'c');
insert into bomComp values('a0195','a0196',3,'b');
insert into bomComp values('a0195','a0197',1,'c');
insert into bomComp values('a0197','a0198',2,'c');
insert into bomComp values('a0198','a0199',4,'b');
insert into bomComp values('a0198','a0200',2,'b');
insert into bomComp values('a0198','a0087',2,'b');

insert into bomPrice values('a0038',3);
insert into bomPrice values('a0043',2);
insert into bomPrice values('a0052',4);
insert into bomPrice values('a0053',3);
insert into bomPrice values('a0055',4);
insert into bomPrice values('a0058',2);
insert into bomPrice values('a0059',5);
insert into bomPrice values('a0064',2);
insert into bomPrice values('a0067',3);
insert into bomPrice values('a0073',2);
insert into bomPrice values('a0074',2);
insert into bomPrice values('a0081',4);
insert into bomPrice values('a0087',2);
insert into bomPrice values('a0095',3);
insert into bomPrice values('a0097',2);
insert into bomPrice values('a0102',4);
insert into bomPrice values('a0104',3);
insert into bomPrice values('a0114',5);
insert into bomPrice values('a0115',2);
insert into bomPrice values('a0122',3);
insert into bomPrice values('a0123',4);
insert into bomPrice values('a0124',2);
insert into bomPrice values('a0127',2);
insert into bomPrice values('a0128',4);
insert into bomPrice values('a0133',2);
insert into bomPrice values('a0137',3);
insert into bomPrice values('a0146',2);
insert into bomPrice values('a0154',3);
insert into bomPrice values('a0159',4);
insert into bomPrice values('a0166',2);
insert into bomPrice values('a0167',3);
insert into bomPrice values('a0172',4);
insert into bomPrice values('a0178',3);
insert into bomPrice values('a0186',2);
insert into bomPrice values('a0196',3);
insert into bomPrice values('a0199',4);
insert into bomPrice values('a0200',2);
