2022-08-30 20:19:12 -05:00

52 lines
2.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Case Study 1
## Instructions
- Use the Cape\_Codd database
- Use only the Inventory table
- Deliver a single sql file, along with a document that contains all the content from the sql file
- Each query should start with a comment line that looks like:
/* *** CS1-\<CH-Q> *** \*/
Example for Exercise 2.17:
/* *** CS1-2.17*** */
- Do not include the result table unless specifically directed to
- Include at least one line of white space between answers
## Exercises 2.17 - 2.33
2.17) Write a SQL statement to display SKU and SKU\_Description.
2.18) Write a SQL statement to display SKU\_Description and SKU.
2.19) Write a SQL statement to display WarehouseID.
2.20) Write a SQL statement to display unique WarehouseIDs.
2.21) Write a SQL statement to display all of the columns without using the SQL asterisk (wildcard character).
2.22) Write a SQL statement to display all of the columns using the SQL asterisk (wildcard character)
2.23) Write a SQL statement to display all data on products having a QuantityOnHand greater than 0.
2.24) Write a SQL statement to display the SKU and SKU\_Description for products having QuantityOnHand equal to 0.
2.25) Write a 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 a 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 a 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 a 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 a 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 a 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 a SQL statement to show a unique SKU and SKU\_Description for all products with an SKU description starting with Half-Dome.
2.32) Write a SQL statement to show a unique SKU and SKU\_Description for all products with a description that includes the word Climb.
2.33) Write a SQL statement to show a unique SKU and SKU\_Description for all products with a d in the third position from the left in SKU\_Description.