Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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, 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To sort the flavors table in the way you described you can use ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Auditing

Authors: Michael C Knapp

12th Edition

357515404, 978-0357515402

More Books

Students also viewed these Databases questions