2022-08-30 18:33:01 -05:00

52 lines
2.8 KiB
Markdown
Raw 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
- Each query should start with a comment line that looks like:
/* *** CS1-\<CH-Q> *** \*/
Example for Exercies 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 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.
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 with an SKU description starting with Half-Dome.
2.32) Write an SQL statement to show a unique SKU and SKU\_Description for all products with a description that includes the word Climb.
2.33) Write an 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.