Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use only the INVENTORY table to answer Review Questions 2.17 through 2.39: 2.17 Write an SQL statement to display SKU and SKU_Description. 2.18 Write an

image text in transcribed

Use only the INVENTORY table to answer Review Questions 2.17 through 2.39: 2.17 Write an SQL statement to display SKU and SKU_Description. 2.18 Write an SQL statement to display SKU_Description and SKU. 2.19 Write an SQL statement to display WarehouseID. 2.20 Write an SQL statement to display unique WarehouseIDs. 2.21 Write an SQL statement to display all of the columns without using the SQL asterisk () wildcard character. 2.22 Write an SQL statement to display all of the columns using the SQL asterisk (*) wildcard character. 2.23 Write an SQL statement to display all data on products having a QuantityOnHand greater than 0 . PART 1 Getting Started 2.24 Write an SQL statement to display the SKU and SKU_Description for products having QuantityOnHand equal to 0 . 2.25 Write an SQL statement to display the SKU, SKU_Description, and WarehouseID for products that have a QuantityOnHand equal to 0 . Sort the results in ascending order by WarehouseID. 2.26 Write an SQL statement to display the SKU, SKU_Description, and WarehouseID for products that have a QuantityOnHand greater than 0 . Sort the results in descending order by WarehouseID and in ascending order by SKU. 2.27 Write an SQL statement to display SKU, SKU_Description, and WarehouseID for all products that have a QuantityOnHand equal to 0 and a QuantityOnOrder greater than 0 . Sort the results in descending order by WarehouseID and in ascending order by SKU. 2.28 Write an SQL statement to display SKU, SKU_Description, and WarehouseID for all products that have a QuantityOnHand equal to 0 or a QuantityOnOrder equal to 0 . Sort the results in descending order by WarehouseID and in ascending order by SKU. 2.29 Write an SQL statement to display the SKU, SKU_Description, WarehouseID, and QuantityOnHand for all products having a QuantityOnHand greater than 1 and less than 10. Do not use the BETWEEN keyword. 2.30 Write an SQL statement to display the SKU, SKU_Description, WarehouseID, and QuantityOnHand for all products having a QuantityOnHand greater than 1 and less than 10. Use the BETWEEN keyword. 2.31 Write an SQL statement to show a unique SKU and SKU_Description for all products having an SKU description starting with 'Half-Dome'. 2.32 Write an SQL statement to show a unique SKU and SKU_Description for all products having a description that includes the word 'Climb'. 2.33 Write an SQL statement to show a unique SKU and SKU_Description for all products having a ' d ' in the third position from the left in SKU_Description. 2.34 Write an SQL statement that uses all of the SQL built-in functions on the QuantityOnHand column. Include meaningful column names in the result. 2.35 Explain the difference between the SQL built-in functions COUNT and SUM. 2.36 Write an SQL statement to display the WarehouseID and the sum of QuantityOnHand, grouped by WarehouseID. Name the sum TotalItemsOnHand and display the results in descending order of TotalItemsOnHand. 2.37 Write an SQL statement to display the WarehouseID and the sum of QuantityOnHand, grouped by WarehouseID. Omit all SKU items that have 3 or more items on hand from the sum, and name the sum TotalitemsOnHandLT3 and display the results in descending order of TotalitemsOnHandLT3. 2.38 Write an SQL statement to display the WarehouseID and the sum of QuantityOnHand grouped by WarehouseID. Omit all SKU items that have 3 or more items on hand from the sum, and name the sum TotalitemsOnHandLT3. Show the WarehouseID only for warehouses having fewer than 2 SKUs in their TotalitemsOnHandLT3. Display the results in descending order of TotalItemsOnHandLT3. 2.39 In your answer to Review Question 2.38, was the WHERE clause or the HAVING clause applied first? Why

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

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

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions