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

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

create table bomPrice
(
  part   varchar2(5) primary key,
  bomPrice  number 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('a0001','a0005',4,'c');
insert into bomComp values('a0001','a0006',3,'c');
insert into bomComp values('a0001','a0007',1,'c');
insert into bomComp values('a0001','a0008',2,'c');
insert into bomComp values('a0001','a0009',2,'c');
insert into bomComp values('a0001','a0010',3,'c');
insert into bomComp values('a0001','a0011',1,'c');
insert into bomComp values('a0001','a0012',2,'c');
insert into bomComp values('a0001','a0013',3,'c');
insert into bomComp values('a0001','a0014',2,'c');
insert into bomComp values('a0001','a0015',3,'c');
insert into bomComp values('a0001','a0016',1,'c');
insert into bomComp values('a0001','a0017',2,'c');
insert into bomComp values('a0001','a0018',1,'c');
insert into bomComp values('a0001','a0019',2,'c');
insert into bomComp values('a0001','a0020',2,'c');
insert into bomComp values('a0001','a0021',1,'c');
insert into bomComp values('a0001','a0022',2,'c');
insert into bomComp values('a0001','a0023',1,'c');
insert into bomComp values('a0001','a0024',2,'c');
insert into bomComp values('a0001','a0025',1,'c');
insert into bomComp values('a0001','a0026',2,'c');
insert into bomComp values('a0001','a0027',2,'c');
insert into bomComp values('a0001','a0028',1,'c');
insert into bomComp values('a0001','a0029',2,'c');
insert into bomComp values('a0001','a0030',2,'c');
insert into bomComp values('a0002','a0031',3,'c');
insert into bomComp values('a0002','a0032',2,'c');
insert into bomComp values('a0002','a0033',1,'c');
insert into bomComp values('a0002','a0034',2,'c');
insert into bomComp values('a0002','a0035',1,'c');
insert into bomComp values('a0002','a0036',1,'c');
insert into bomComp values('a0002','a0037',2,'c');
insert into bomComp values('a0002','a0038',1,'c');
insert into bomComp values('a0002','a0039',1,'c');
insert into bomComp values('a0002','a0040',1,'c');
insert into bomComp values('a0003','a0041',1,'c');
insert into bomComp values('a0003','a0042',1,'c');
insert into bomComp values('a0003','a0043',2,'c');
insert into bomComp values('a0003','a0044',2,'c');
insert into bomComp values('a0003','a0045',1,'c');
insert into bomComp values('a0004','a0046',2,'c');
insert into bomComp values('a0004','a0047',2,'c');
insert into bomComp values('a0004','a0048',1,'c');
insert into bomComp values('a0004','a0049',1,'c');
insert into bomComp values('a0004','a0050',2,'c');
insert into bomComp values('a0005','a0051',1,'c');
insert into bomComp values('a0005','a0052',2,'c');
insert into bomComp values('a0006','a0053',1,'c');
insert into bomComp values('a0006','a0118',2,'b');
insert into bomComp values('a0006','a0119',3,'b');
insert into bomComp values('a0006','a0120',2,'b');
insert into bomComp values('a0006','a0121',3,'b');
insert into bomComp values('a0007','a0054',1,'c');
insert into bomComp values('a0007','a0055',2,'c');
insert into bomComp values('a0007','a0120',2,'b');
insert into bomComp values('a0007','a0121',3,'b');
insert into bomComp values('a0008','a0056',1,'c');
insert into bomComp values('a0008','a0057',1,'c');
insert into bomComp values('a0008','a0058',1,'c');
insert into bomComp values('a0009','a0046',2,'c');
insert into bomComp values('a0009','a0048',1,'c');
insert into bomComp values('a0009','a0054',1,'c');
insert into bomComp values('a0010','a0050',1,'c');
insert into bomComp values('a0010','a0051',1,'c');
insert into bomComp values('a0010','a0052',2,'c');
insert into bomComp values('a0010','a0053',2,'c');
insert into bomComp values('a0011','a0054',1,'c');
insert into bomComp values('a0011','a0059',2,'c');
insert into bomComp values('a0011','a0048',1,'c');
insert into bomComp values('a0012','a0060',1,'c');
insert into bomComp values('a0012','a0061',2,'c');
insert into bomComp values('a0013','a0062',2,'c');
insert into bomComp values('a0013','a0063',1,'c');
insert into bomComp values('a0014','a0064',1,'c');
insert into bomComp values('a0014','a0076',2,'b');
insert into bomComp values('a0014','a0078',3,'b');
insert into bomComp values('a0014','a0079',2,'b');
insert into bomComp values('a0015','a0065',1,'c');
insert into bomComp values('a0015','a0066',1,'c');
insert into bomComp values('a0016','a0067',2,'c');
insert into bomComp values('a0016','a0090',3,'b');
insert into bomComp values('a0016','a0092',2,'b');
insert into bomComp values('a0016','a0093',4,'b');
insert into bomComp values('a0017','a0068',1,'c');
insert into bomComp values('a0017','a0101',3,'b');
insert into bomComp values('a0017','a0102',3,'b');
insert into bomComp values('a0017','a0104',2,'b');
insert into bomComp values('a0018','a0069',1,'c');
insert into bomComp values('a0018','a0079',2,'b');
insert into bomComp values('a0018','a0082',3,'b');
insert into bomComp values('a0018','a0084',2,'b');
insert into bomComp values('a0019','a0056',2,'c');
insert into bomComp values('a0019','a0062',2,'c');
insert into bomComp values('a0020','a0061',1,'c');
insert into bomComp values('a0020','a0069',2,'c');
insert into bomComp values('a0021','a0062',1,'c');
insert into bomComp values('a0021','a0064',1,'c');
insert into bomComp values('a0022','a0069',1,'c');
insert into bomComp values('a0022','a0080',3,'b');
insert into bomComp values('a0022','a0086',2,'b');
insert into bomComp values('a0023','a0070',2,'c');
insert into bomComp values('a0024','a0066',3,'c');
insert into bomComp values('a0025','a0068',1,'c');
insert into bomComp values('a0026','a0069',1,'c');
insert into bomComp values('a0027','a0070',1,'c');
insert into bomComp values('a0027','a0071',1,'c');
insert into bomComp values('a0028','a0049',1,'c');
insert into bomComp values('a0029','a0072',1,'c');
insert into bomComp values('a0030','a0073',1,'c');
insert into bomComp values('a0030','a0074',2,'b');

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

insert into bomComp values('a0072','a0116',5,'b');
insert into bomComp values('a0073','a0117',2,'b');

insert into bomPrice values('a0074',3);
insert into bomPrice values('a0075',2);
insert into bomPrice values('a0076',4);
insert into bomPrice values('a0077',3);
insert into bomPrice values('a0078',4);
insert into bomPrice values('a0079',2);
insert into bomPrice values('a0080',5);
insert into bomPrice values('a0081',2);
insert into bomPrice values('a0082',3);
insert into bomPrice values('a0083',2);
insert into bomPrice values('a0084',2);
insert into bomPrice values('a0085',4);
insert into bomPrice values('a0086',2);
insert into bomPrice values('a0087',3);
insert into bomPrice values('a0088',2);
insert into bomPrice values('a0089',4);
insert into bomPrice values('a0090',3);
insert into bomPrice values('a0091',5);
insert into bomPrice values('a0092',2);
insert into bomPrice values('a0093',3);
insert into bomPrice values('a0094',4);
insert into bomPrice values('a0095',2);
insert into bomPrice values('a0096',2);
insert into bomPrice values('a0097',4);
insert into bomPrice values('a0098',2);
insert into bomPrice values('a0099',3);
insert into bomPrice values('a0100',2);
insert into bomPrice values('a0101',3);
insert into bomPrice values('a0102',4);
insert into bomPrice values('a0103',2);
insert into bomPrice values('a0104',3);
insert into bomPrice values('a0105',4);
insert into bomPrice values('a0106',3);
insert into bomPrice values('a0107',2);
insert into bomPrice values('a0108',3);
insert into bomPrice values('a0109',4);
insert into bomPrice values('a0110',2);
insert into bomPrice values('a0111',3);
insert into bomPrice values('a0112',2);
insert into bomPrice values('a0113',4);
insert into bomPrice values('a0114',2);
insert into bomPrice values('a0115',2);
insert into bomPrice values('a0116',3);
insert into bomPrice values('a0117',2);
insert into bomPrice values('a0118',2);
insert into bomPrice values('a0119',2);
insert into bomPrice values('a0120',3);
insert into bomPrice values('a0121',2);
insert into bomPrice values('a0122',4);
insert into bomPrice values('a0123',2);
insert into bomPrice values('a0124',3);
insert into bomPrice values('a0125',2);
insert into bomPrice values('a0126',3);
insert into bomPrice values('a0127',4);
insert into bomPrice values('a0128',2);
insert into bomPrice values('a0129',3);
insert into bomPrice values('a0130',4);
insert into bomPrice values('a0131',3);
insert into bomPrice values('a0132',2);
insert into bomPrice values('a0133',3);
insert into bomPrice values('a0134',4);
insert into bomPrice values('a0135',2);
insert into bomPrice values('a0136',3);
insert into bomPrice values('a0137',2);
insert into bomPrice values('a0138',4);
insert into bomPrice values('a0139',2);
insert into bomPrice values('a0140',2);
insert into bomPrice values('a0141',3);
insert into bomPrice values('a0142',2);
insert into bomPrice values('a0143',2);
insert into bomPrice values('a0144',2);
insert into bomPrice values('a0145',3);
insert into bomPrice values('a0146',2);
insert into bomPrice values('a0147',2);
insert into bomPrice values('a0148',3);
insert into bomPrice values('a0149',2);
insert into bomPrice values('a0150',2);
insert into bomPrice values('a0151',2);
insert into bomPrice values('a0152',3);
insert into bomPrice values('a0153',2);
insert into bomPrice values('a0154',4);
insert into bomPrice values('a0155',3);
insert into bomPrice values('a0156',2);
insert into bomPrice values('a0157',3);
insert into bomPrice values('a0158',4);
insert into bomPrice values('a0159',2);
insert into bomPrice values('a0160',3);
insert into bomPrice values('a0161',2);
insert into bomPrice values('a0162',4);
insert into bomPrice values('a0163',2);
insert into bomPrice values('a0164',2);
insert into bomPrice values('a0165',3);
insert into bomPrice values('a0166',2);
insert into bomPrice values('a0167',2);
insert into bomPrice values('a0168',2);
insert into bomPrice values('a0169',3);
insert into bomPrice values('a0170',2);
insert into bomPrice values('a0171',2);
insert into bomPrice values('a0172',3);
insert into bomPrice values('a0173',2);
insert into bomPrice values('a0174',2);
insert into bomPrice values('a0175',2);
insert into bomPrice values('a0176',3);
insert into bomPrice values('a0177',2);
insert into bomPrice values('a0178',4);
insert into bomPrice values('a0179',3);
insert into bomPrice values('a0180',2);
insert into bomPrice values('a0181',3);
insert into bomPrice values('a0182',4);
insert into bomPrice values('a0183',2);
insert into bomPrice values('a0184',3);
insert into bomPrice values('a0185',2);
insert into bomPrice values('a0186',4);
insert into bomPrice values('a0187',2);
insert into bomPrice values('a0188',2);
insert into bomPrice values('a0189',3);
insert into bomPrice values('a0190',2);
insert into bomPrice values('a0191',2);
insert into bomPrice values('a0192',2);
insert into bomPrice values('a0193',3);
insert into bomPrice values('a0194',2);
insert into bomPrice values('a0195',2);
insert into bomPrice values('a0196',3);
insert into bomPrice values('a0197',2);
insert into bomPrice values('a0198',2);
insert into bomPrice values('a0199',2);
insert into bomPrice values('a0200',3);
