Task 12: List the item ID, description, and category for each pair of items that are in the same category. (For example, one such pair would be item FS42 and item PF19, because the category for both items is FSH.) Order the output by category.
Task 12: List the item ID, description, and category for each pair of items that are in the same category. (For example, one such pair would be item FS42 and item PF19, because the category for both items is FSH.) Order the output by category.
Creating table ITEMS:
create table ITEMS(
item_id varchar2(5) Primary Key,
Description varchar2(30),
on_hand Number(3),
Category varchar2(3),
Location varchar2(1),
Price Number(6,2));
Inserting Data into ITEMS table:
insert into ITEMS values('AD72','Dog Feeding Station',12,'DOG','B',79.99);
insert into ITEMS values('BC33','Feathers Bird cagr(12*24*18)',10,'BRD','B',79.99);
insert into ITEMS values('CA75','Enclosed Cat Litter Station',15,'CAT','C',39.99);
insert into ITEMS values('DT12','Dog Toy Gift Set',27,'DOG','B',39.99);
insert into ITEMS values('FM23','Fly Mask With Ears',41,'HOR','C',24.95);
insert into ITEMS values('FS39','Folding Saddle Stand',12,'HOR','C',39.99);
insert into ITEMS values('FS42','Aquarium(55 Gallon)',5,'FSH','A',124.99);
insert into ITEMS values('KH81','Wild Bird Food(25 lb)',24,'BRD','C',19.99);
insert into ITEMS values('LD14','Locking Small Dog Door',14,'DOG','A',49.99);
insert into ITEMS values('LP73','Large Pet Carrier',23,'DOG','B',59.99);
Output Snapshot:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images