Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use SQL Workbench and ONLY answer the EVEN numbered questions. KimTay Pet Supplies Use SQL and the KimTay Pet Supplies database (see Figure 1-2 in
Use SQL Workbench and ONLY answer the EVEN numbered questions.
KimTay Pet Supplies Use SQL and the KimTay Pet Supplies database (see Figure 1-2 in Module 1) to complete the following exercises. If directed to do so by your instructor, use the information provided with the Module 3 Exercises to print your output or save it to a document. 1. List the item ID, description, and price for all items. 2. List all rows and columns for the complete INVOICES table. 3. List the first and last names of customers with credit limits of $1,000 or more. 4. List the order number for each order placed by customer number 125 on 11/15/2021. (Hint: If you need help, use the discussion of the DATE data type in Figure 3-19 in Module 3.) 5. List the number and name of each customer represented by sales rep 10 or sales rep 15 . 6. List the item ID and description of each item that is not in category HOR. 7. List the item ID, description, and number of units on hand for each item that has between 10 and 30 units on hand, including both 10 and 30 . Provide two alternate SQL statements 8. List the item ID, description, and on-hand value (units on hand * unit price) of each item in category CAT. (On-hand value is technically units on hand * cost, but there is no COST column in the ITEM table.) Assign the name ON_HAND_VALUE to the computed column. 9. List the item ID, description, and on-hand value for each item where the on-hand value is at least $1,500. Assign the name ON_HAND_VALUE to the computed column. 10. Use the IN operator to list the item ID and description of each item in category FSH or GRD. 11. Find the ID, first name, and last name of each customer whose first name begins with the letter "S." 12. List all details about all items, Order the output by description. 13. List all details about all items. Order the output by item ID within location. (That is, order the output by location and then by item ID.) 14. How many customers have balances that are more than their credit limits? 15. Find the total of the balances for all customers represented by sales rep 10 with balances that are less than their credit limits. 16. List the item ID, description, and on-hand value of each item whose number of units on hand is more than the average number of units on hand for all items. (Hint: Use a subquery.) 17. What is the price of the least expensive item in the database? 18. What is the item ID, description, and price of the least expensive item in the database? (Hint: Use a subquery.) 19. List the sum of the balances of all customers for each sales rep. Order and group the results by sales rep ID. 20. List the sum of the balances of all customers for each sales rep but restrict the output to those sales reps for which the sum is more than $150. Order the results by sales Iep ID. 21. List the item ID of any item with an unknown description. Introduction to KimTay Pet Supplies and StayWell Student Accommodation Databases In the SALES_REP table, you see that there are four reps, whose ID values are 05,10,15, and 20. The name of sales rep 05 is Susan Garcia. Her street address is 42 Mountain Ln. She lives in Cody, WY, and her postal code is 82414 . Her cell phone number is 3078241245. Her total commission is $12,743.16, and her commission rate is 0.04 (four percent). In the CUSTOMER table, 12 KimTay Pet Supplies customers are identified with the ID values of 126,182,227,294,314,375,435,492,543,616,721, and 795 . The name of customer number 126 is Joey Smith. This customer's address is 17 Fourth St in Cody, WY, with a postal code of 82414 . The e-mail address of the customer is jsmith 17 (c example.com. The customer's current balance is $80.68, and their credit limit is 8500. The value 05 in the REP_ID column indicates that Joey Smith is represented by sales rStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started