Question: Task 1 2 : List the item ID , description, and category for each pair of items that are in the same category. ( For

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.
Code I input:
SELECT F.CATEGORY, F.ITEM_ID, F.DESCRIPTION
FROM ITEM F, ITEM S
WHERE F.CATEGORY = S.CATEGORY
AND F.ITEM_ID <> S.ITEM_ID
AND S.CATEGORY IN ('BRD', 'CAT', 'FSH')
ORDER BY F.CATEGORY;
Test Feedback I recieved:
Status: FAILED!
Check: 1
Test: **Task 12:** List the item ID, description, and category for each pair of items that are in the same category
Reason: Expected:
+----------+---------+-------------------------------+
| CATEGORY | ITEM_ID | DESCRIPTION |
+----------+---------+-------------------------------+
| BRD | BC33| Feathers Bird Cage (12x24x18)|
| BRD | KH81| Wild Bird Food (25 lb)|
| CAT | CA75| Enclosed Cat Litter Station |
| CAT | SP91| Small Pet Carrier |
| FSH | FS42| Aquarium (55 Gallon)|
| FSH | PF19| Pump & Filter Kit |
+----------+---------+-------------------------------+
Found:
+----------+---------+-------------------------------+
| CATEGORY | ITEM_ID | DESCRIPTION |
+----------+---------+-------------------------------+
| BRD | KH81| Wild Bird Food (25 lb)|
| BRD | BC33| Feathers Bird Cage (12x24x18)|
| CAT | SP91| Small Pet Carrier |
| CAT | CA75| Enclosed Cat Litter Station |
| FSH | PF19| Pump & Filter Kit |
| FSH | FS42| Aquarium (55 Gallon)|
+----------+---------+-------------------------------+
Error : AssertionError -
Timestamp: 2024-02-2619:12:42.674146
----------
Can you please show me where I went wrong?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!