Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Submit a SQL query that ranks the number of product units in stock from the Northwind database into five categories. The first category should list

Submit a SQL query that ranks the number of product units in stock from the Northwind database into five categories. The first category should list the most abundant items in the inventory, the second category should list the second most abundant items in the inventory, and so on. The output of your query result should contain the following header columns: Product Name, Units in Stock, and NTILE. The ideal output should be a table that reads as follows:

image text in transcribed

image text in transcribed

unitslnStock NTILE 125 123 120 115 113 112 112 productname 1 Rhnbru Klosterbier 2 Boston Crab Meat 3 Grandma's Boysenbemy Spread 4Pt chinois 5 Sirop d'rable 6Inlagd Sill 7 Geitost 8 Sasquatch Ale 9 Gustafs Knckebrd 10 Rd Kaviar 11 Spegesild 12 Queso Manchego La Pastora 13 Jack's New England Clam Chowder 85 14 Raclette Courdavault 15 Louisiana Fiery Hot Pepper Sauce 76 16 NuNuCa Nu-Nougat-Creme 17 Chartreuse verte 18 Valkoinen suklaa 19 Escargots de Bourgogne 20 Tunnbrd 21 Lakkalikri 104 101 95 86 79 76 65 62 61 i/ 53 52 22 Chef Anton's Cajun Seasoning 23 24 25 26 27 28 29 Laughing Lumberjack Lager Schoggi Schokolade Camarvon Tigers Sir Rodney's Marmalade Genen Shouyu Chai Filo Mix 42 39 39 38 Employees Orders Customers LastName TiteOfCourtesy BirthDate Shippers ShipAddress CompanyName Phone PostalCode Suppliers Products ReportsTo Order Details OrderID Categories CategoryID CategoryName ntry Description Picture UnitPrice Discount HomePage unitslnStock NTILE 125 123 120 115 113 112 112 productname 1 Rhnbru Klosterbier 2 Boston Crab Meat 3 Grandma's Boysenbemy Spread 4Pt chinois 5 Sirop d'rable 6Inlagd Sill 7 Geitost 8 Sasquatch Ale 9 Gustafs Knckebrd 10 Rd Kaviar 11 Spegesild 12 Queso Manchego La Pastora 13 Jack's New England Clam Chowder 85 14 Raclette Courdavault 15 Louisiana Fiery Hot Pepper Sauce 76 16 NuNuCa Nu-Nougat-Creme 17 Chartreuse verte 18 Valkoinen suklaa 19 Escargots de Bourgogne 20 Tunnbrd 21 Lakkalikri 104 101 95 86 79 76 65 62 61 i/ 53 52 22 Chef Anton's Cajun Seasoning 23 24 25 26 27 28 29 Laughing Lumberjack Lager Schoggi Schokolade Camarvon Tigers Sir Rodney's Marmalade Genen Shouyu Chai Filo Mix 42 39 39 38 Employees Orders Customers LastName TiteOfCourtesy BirthDate Shippers ShipAddress CompanyName Phone PostalCode Suppliers Products ReportsTo Order Details OrderID Categories CategoryID CategoryName ntry Description Picture UnitPrice Discount HomePage

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions