Giffords is committed to its customers, and therefore wants to present their allergen information in a sorted
Question:
Giffords is committed to its customers, and therefore wants to present their allergen information in a sorted way so that items with the same allergen profile will be together in the representation.
Choose an order of the allergens and sort the Flavors table in that way. Within the group with the same allergens, sort the names ascending. At the same time, rank the flavors by that perspective so that there is a flavor 1 for each combination.
The Table looks like this
CREATE TABLE flavors
(
FID VARCHAR(512),
Flavor VARCHAR(512),
Type VARCHAR(512),
Gluten VARCHAR(512),
Nuts VARCHAR(512),
Chocolate VARCHAR(512),
Fruit VARCHAR(512),
Seasonal VARCHAR(512)
);
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('AP', 'Apple Pie', 'I', 'Y', 'N', 'N', 'Y', 'Y');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('AJPBM', 'Aroma Joe's PB Mocha', 'I', 'N', 'Y', 'N', 'N', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('BCP', 'Banana Cream Pie', 'I', 'Y', 'N', 'N', 'Y', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('BFCF', 'Black Forest Cherry Fudge', 'I', 'N', 'N', 'Y', 'Y', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('BR', 'Black Raspberry', 'I', 'N', 'N', 'N', 'Y', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('BRCC', 'Black Raspberry Chocolate Chip', 'FY', 'N', 'N', 'Y', 'Y', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate, Fruit, Seasonal) VALUES ('BMC', 'Blue Monstah Cookie', 'I', 'Y', 'N', 'N', 'N', 'N');
INSERT INTO flavors (FID, Flavor, Type, Gluten, Nuts, Chocolate,