Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Database Model: KimTay The management of KimTay Pet Supplies (a supplier of pet supplies, food, and accessories located in Cody, Wyoming) has determined that the

Database Model: KimTay The management of KimTay Pet Supplies (a supplier of pet supplies, food, and accessories located in Cody, Wyoming) has determined that the companys recent growth no longer makes it feasible to maintain customer, invoice, and inventory data using its manual systems. In addition, KimTay Pet Supplies wants to build an Internet presence. With the data stored in a database, management will be able to ensure that the data is up-to-date and more accurate than in the current manual systems. In addition, managers will be able to obtain answers to their questions concerning the data in the database easily and quickly, with the option of producing a variety of useful reports.

The CUSTOMER table maintains information about each customer, such as their ID, first and last name, address, balance, and credit limit.

image text in transcribed

In the INVOICES table contains information about each invoice, such as the invoice number, date, and the customer being invoiced.

image text in transcribed

The INVOICE_LINE table has the itemized information for each invoice. This includes the item ids, quantity, and price for each invoice.

image text in transcribed

The ITEM table has a information pertaining to each item for sale by KimTay's Pet Supplies. This includes a description, the number in stock, location, and price.

image text in transcribed

The SALES_REP table includes the information for each sales representative for KimTay's Pet Supplies. This includes first and last name, address, cell-phone, commission, and commission rate.

image text in transcribed

Task 1: List the item ID, description, and price for all items.

Task 2: List all rows and columns for the complete INVOICES table.

Task 3: List the first name, last name, and credit limit of customers with credit limits of $1,000 or more.

Task 4: List the order number for each order placed by customer number 125 on 2021-11-15.

Task 5: List the customer ID, the first name, and the last name of each customer represented by sales rep 10 or sales rep 15.

Task 6: List the item ID and description of each item that is not in category HOR.

Task 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.

Task 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.

Task 9: List the item ID, description, and on-hand value for each item where on-hand value is at least $1,500. Assign the name ON_HAND_VALUE to the computed column.

Task 10: Use the IN operator to list the item ID and description of each item in category FSH or BRD.

Task 11: Find the ID, first name, and last name of each customer whose first name begins with the letter S.

Task 12: List all details about all items. Order the output by description.

Task 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.)

Task 14: How many customers have balances that are more than their credit limits?

Task 15: Find the total of the balances for all customers represented by sales rep 10 with balances that are less than their credit limits

Task 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.

Use a subquery.

Task 17: What is the price of the least expensive item in the database?

Task 18: What is the item ID, description, and price of the least expensive item in the database?

Use a subquery.

Task 19: List the REP_ID and the corresponding sum of the balances, as BALANCE, of all customers for each sales rep. Order and group the results by sales rep ID.

Task 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.

The results should display the REP_ID and BALANCE column headers. Order the results by sales REP_ID.

Task 21: List the item ID, description, and category of all items that are in the DOG or CAT category and contain the word Small in the description.

Task 22: KimTay Pet Supplies is considering discounting the price of all items by 10 percent. List the item ID, description, price, and discounted price for all items. Use DISCOUNTED_PRICE as the name for the computed column.

CUST_ID FIRST_NAME LAST_NAME ADDRESS CITY STATE POSTAL EMAIL BALANCE CREDIT_LIMIT REP_ID 125 Joey Smith 17 Fourth St Cody WY 82414 jsmith17@example.com 80.68 500.00 05 182 Billy Rufton 21 Simple Cir Garland WY 82435 billyruff@example.com 43.13 750.00 10 227 Sandra Pincher 53 Verde Ln Powell WY 82440 spinch2@example.com 156.38 500.00 15 294 Samantha Smith 14 Rock Ln Ralston WY 82440 ssmith5@example.com 58.60 500.00 10 314 Tom Rascal 1 Rascal Farm Rd Cody WY 82414 trascal@example.com 17.25 250.00 15 375 Melanie Jackson 42 Blackwater Way Elk Butte WY 82433 mjackson5@example.com 252.25 250.00 05 435 James Gonzalez 16 Rockway Rd Wapiti WY 82450 jgonzo@example.com 230.40 1000.00 15 492 Elmer Jackson 22 Jackson Farm Rd Garland WY 82435 ejackson4@example.com 45.20 500.00 10 543 Angie Hendricks 27 Locklear Ln Powell WY 82440 ahendricks7@example.com 315.00 750.00 05 616 Sally Cruz 199 18th Ave Ralston WY 82440 scruz5@example.com 8.33 500.00 15 721 Leslie Smith 123 Sheepland Rd Elk Butte WY 82433 Ismith12@example.com 166.65 1000.00 10 795 Randy Blacksmith 75 Stream Rd Cody WY 82414 rblacksmith@example.com 61.50 500.00 05 INVOICE_NUM INVOICE_DATE CUST_ID 14216 2021-11-15 125 14219 2021-11-15 227 14222 2021-11-16 294 14224 2021-11-16 182 14228 2021-11-18 435 14231 2021-11-18 125 14233 2021-11-18 435 14237 2021-11-19 616 INVOICE_NUM ITEM_ID QUANTITY QUOTED_PRICE 14216 CA75 3 3 37.99 14219 AD72 2 2 79.99 14219 DT12 4 39.99 14222 LD14 1 47.99 14224 KH81 4 18.99 14228 FS42 1 124.99 14228 PF19 1 74.99 14231 UF39 2 2 189.99 14233 KH81 1 19.99 14233 QB92 4 109.95 14233 WB49 4 74.95 14237 LP73 3 54.95 ITEM_ID DESCRIPTION ON_HAND CATEGORY LOCATION PRICE AD72 Dog Feeding Station 12 DOG B 79.99 BC33 Feathers Bird Cage (12x24x18) 10 BRD B 79.99 CA75 Enclosed Cat Litter Station 15 CAT 39.99 DT12 Dog Toy Gift Set 27 DOG B 39.99 FM23 Fly Mask with Ears 41 HOR 24.95 FS39 Folding Saddle Stand 12 HOR C 39.99 FS42 Aquarium (55 Gallon) 5 FSH A 124.99 KH81 Wild Bird Food (25 lb) 24 BRD C 19.99 LD14 Locking Small Dog Door 14 DOG 49.99 LP73 Large Pet Carrier 23 DOG B 59.99 REP ID FIRST_NAME LAST_NAME ADDRESS CITY STATE POSTAL CELL PHONE COMMISSION RATE 05 Susan Garcia 42 Mountain Ln Cody WY 82414 307-824-1245 12743.16 0.04 10 Richard Miller 87 Pikes Dr Ralston WY 82440 307-406-4321 20872.11 0.06 15 Donna Smith 312 Oak Rd Powell WY 82440 307-982-8401 14912.92 0.04 20 Daniel Jackson 19 Lookout Dr Elk Butte WY 82433 307-883-9481 0.00 0.04 CUST_ID FIRST_NAME LAST_NAME ADDRESS CITY STATE POSTAL EMAIL BALANCE CREDIT_LIMIT REP_ID 125 Joey Smith 17 Fourth St Cody WY 82414 jsmith17@example.com 80.68 500.00 05 182 Billy Rufton 21 Simple Cir Garland WY 82435 billyruff@example.com 43.13 750.00 10 227 Sandra Pincher 53 Verde Ln Powell WY 82440 spinch2@example.com 156.38 500.00 15 294 Samantha Smith 14 Rock Ln Ralston WY 82440 ssmith5@example.com 58.60 500.00 10 314 Tom Rascal 1 Rascal Farm Rd Cody WY 82414 trascal@example.com 17.25 250.00 15 375 Melanie Jackson 42 Blackwater Way Elk Butte WY 82433 mjackson5@example.com 252.25 250.00 05 435 James Gonzalez 16 Rockway Rd Wapiti WY 82450 jgonzo@example.com 230.40 1000.00 15 492 Elmer Jackson 22 Jackson Farm Rd Garland WY 82435 ejackson4@example.com 45.20 500.00 10 543 Angie Hendricks 27 Locklear Ln Powell WY 82440 ahendricks7@example.com 315.00 750.00 05 616 Sally Cruz 199 18th Ave Ralston WY 82440 scruz5@example.com 8.33 500.00 15 721 Leslie Smith 123 Sheepland Rd Elk Butte WY 82433 Ismith12@example.com 166.65 1000.00 10 795 Randy Blacksmith 75 Stream Rd Cody WY 82414 rblacksmith@example.com 61.50 500.00 05 INVOICE_NUM INVOICE_DATE CUST_ID 14216 2021-11-15 125 14219 2021-11-15 227 14222 2021-11-16 294 14224 2021-11-16 182 14228 2021-11-18 435 14231 2021-11-18 125 14233 2021-11-18 435 14237 2021-11-19 616 INVOICE_NUM ITEM_ID QUANTITY QUOTED_PRICE 14216 CA75 3 3 37.99 14219 AD72 2 2 79.99 14219 DT12 4 39.99 14222 LD14 1 47.99 14224 KH81 4 18.99 14228 FS42 1 124.99 14228 PF19 1 74.99 14231 UF39 2 2 189.99 14233 KH81 1 19.99 14233 QB92 4 109.95 14233 WB49 4 74.95 14237 LP73 3 54.95 ITEM_ID DESCRIPTION ON_HAND CATEGORY LOCATION PRICE AD72 Dog Feeding Station 12 DOG B 79.99 BC33 Feathers Bird Cage (12x24x18) 10 BRD B 79.99 CA75 Enclosed Cat Litter Station 15 CAT 39.99 DT12 Dog Toy Gift Set 27 DOG B 39.99 FM23 Fly Mask with Ears 41 HOR 24.95 FS39 Folding Saddle Stand 12 HOR C 39.99 FS42 Aquarium (55 Gallon) 5 FSH A 124.99 KH81 Wild Bird Food (25 lb) 24 BRD C 19.99 LD14 Locking Small Dog Door 14 DOG 49.99 LP73 Large Pet Carrier 23 DOG B 59.99 REP ID FIRST_NAME LAST_NAME ADDRESS CITY STATE POSTAL CELL PHONE COMMISSION RATE 05 Susan Garcia 42 Mountain Ln Cody WY 82414 307-824-1245 12743.16 0.04 10 Richard Miller 87 Pikes Dr Ralston WY 82440 307-406-4321 20872.11 0.06 15 Donna Smith 312 Oak Rd Powell WY 82440 307-982-8401 14912.92 0.04 20 Daniel Jackson 19 Lookout Dr Elk Butte WY 82433 307-883-9481 0.00 0.04

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

Students also viewed these Databases questions