Question: Task 8, Repeat Task 7, but this time order the rows by category and then by invoice number. SQL Instructions Page 1 of 4 The

 Task 8, Repeat Task 7, but this time order the rows

by category and then by invoice number. SQL Instructions Page 1 of

4 The management of Kim Tay Pet Supplies (a supplier of pet

supplies, food, and accessories located in Cody, Wyoming) has determined that the

company's recent growth no longer makes it feasible to maintain customer, invoice,

and inventory data using its manual systems. In addition, KimTay Pet Supplies

Task 8, Repeat Task 7, but this time order the rows by category and then by invoice number.

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

SQL

Instructions Page 1 of 4 The management of Kim Tay Pet Supplies (a supplier of pet supplies, food, and accessories located in Cody, Wyoming) has determined that the company's 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. 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 T82 Billy Rufton 21 Simple Cir Garland WY 82435 billyruff@example.com 43.13 750.00 10 22 Sandra Pincher 53 Verden Powell WY 82440 spinch2@example.com 156.38 500.00 15 294 Samantha Smith 14 Rock Ln Ralston WY 82440 ssmith@example.com 58.60 500.00 10 314 Torm 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 252 25 250.00 05 mjackson5@example.com jgonzo@example.com 435 James Gonzalez T6 Rockway Rd Wapiti WY 82450 230.40 1000.00 15 492 Elmer Jackson 22 Jackson Farm Rd Garland WY 82435 ejackson@example.com 45.20 500.00 10 543 Angie Hendricks 27 Locklear in Powell WY 82440 ahendricks7@example.com 315.00 750.00 05 616 Sally Cruz 799 18th Ave Ralston WY 82440 scruz@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 CUSTOMER table In the INVOICES table contains information about each invoice, such as the invoice number, date, and the customer being invoiced. 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 INVOICES table The INVOICE_LINE table has the itemized information for each invoice. This includes the item ids, quantity, and price for each invoice. INVOICE NUM ITEM_ID QUANTITY QUOTED_PRICE 14216 CA75 3 37.99 14219 AD72 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 189.99 14233 KH81 1 19.99 14233 QB92 4 109.95 14233 WB49 4 74.95 14237 LP73 3 54.95 INVOICE LINE table 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. ITEM_ID DESCRIPTION ON HAND CATEGORY LOCATION PRICE AD72 Dog Feeding Station 12 DOG 79.99 BC33 Feathers Bird Cage (12X24X18) 10 BRD B 79.99 CAS 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 39.99 FS42 Aquarium (55 Gallon) 5 FSH A 124.99 KHS1 Wild Bird Food (25 lb) 24 BRD 19.99 LD 14 Locking Small Dog Door DOG A 49.99 LP73 Large Pet Carrier 23 DOG B 59.99 ITEM table LP73 Large Pet Carrier 23 DOG B 59.99 ITEM table 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. REP ID FIRST NAME LAST NAME ADDRESS CITY STATE POSTAL CELL PHONE COMMISSION RATE 05 Susan Garcia 42 Mountain Ln Cody WY 82414 307-8241245 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 SALES REP table Grading After you have completed a problem and clicked the Run Query button, mark the task as complete. Checks will run to verify your work. When all problems are completed and you are satisfied with the results, use the Submit button to record your score. Tasks Task 1: For each invoice, list the invoice number and invoice date along with the ID, first name, and last name of the customer for which the invoice was created. Task 2: For each invoice placed on November 15, 2021, list the invoice number along with the ID, first name, and last name of the customer for which the invoice was created Task 3: For each invoice, list the invoice number, invoice date, item ID, quantity ordered, and quoted price for each invoice line that makes up the invoice. Task 4: Use the IN operator to find the ID, first name, and last name of each customer for which as invoice was created on November 15, 2021. Task 5: Repeat Task 4, but this time use the EXISTS operator in your answer. Task 6: Find the ID, first name, and last name of each customer for which an invoice was not created on November 15, 2021. Task 7: For each invoice, list the invoice number, invoice date, item ID, description, and category for each item that makes up the invoice. Task 9: Use a subquery to find the sales rep ID, first name, and last name of each sales rep who represents at least one customer with a credit limit of $500. List each sales rep only once in the results. Task 10: Repeat Task 9, but this time do not use a subquery. Task 11: Find the ID, first name, and last name of each customer that currently has an invoice on file for Wild Bird Food (25 lb). Task 12: List the item ID, description, and category for each pair of items that are in the same category. (For example, one such pair would be item FS42 and item PF19, because the category for both items is FSH.) Order the output by category. Task 13: List the invoice number and invoice date for each invoice created for the customer James Gonzalez. Task 14: List the invoice number and invoice date for each invoice that contains an invoice line for a Wild Bird Food (25 lb). Task 15: List the invoice number and invoice date for each invoice that either was created for lames Gonzalez or that contains an invoice line for Wild Bird Food ) Task 10: Repeat Task 9, but this time do not use a subquery. ] Task 11: Find the ID, first name, and last name of each customer that currently has an invoice on file for Wild Bird Food (25 lb). ] Task 12: List the item ID, description, and category for each pair of items that are in the same category. (For example, one such pair would be item FS42 and item PF19, because the category for both items is FSH.) Order the output by category. ] Task 13: List the invoice number and invoice date for each invoice created for the customer James Gonzalez. Task 14: List the invoice number and invoice date for each invoice that contains an invoice line for a Wild Bird Food (25 lb). Task 15: List the invoice number and invoice date for each invoice that either was created for James Gonzalez or that contains an invoice line for Wild Bird Food (251b). Task 16: List the invoice number and invoice date for each invoice that was created for James Gonzalez and that contains an invoice line for Wild Bird Food (251b). Task 17: List the invoice number and invoice date for each invoice that was created for James Gonzalez but that does not contain an invoice line for Wild Bird Food (251b). Task 18: List the item ID, description, unit price, and category for each item that has a unit price greater than the unit price of every item in category CAT . Use the ALL operator in your query. Task 19: For each item, list the item ID, description, units on hand, invoice number, and quantity ordered. All items should be included in the results. For those items that are currently not on an invoice, the invoice number and quantity ordered should be left blank. Order the results by item ID. Task 20: Repeat Task 18 using the ANY operator. Task 21: For each sales rep, list the ID, first name, and last name for the customer, along with the sales rep first name, and sales rep last name. All reps should be included in the results. Order the results by rep ID

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!