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 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. Task 1: List the item ID as ITEM_ID and description as ITEM_DESC for all items. The descriptions should appear in uppercase letters. Task 2: List the customer ID and first and last names for all customers located in the city of Cody. Your query should ignore case. For example, a customer with the city Cody should be included, as should customers whose city is CODY, cody, cOdY, and so on. Task 3: List the customer ID, first and last names, and balance for all customers. The balance should be rounded to the nearest dollar.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

Task 1: List the item ID as ITEM_ID and description as ITEM_DESC for all items. The descriptions should appear in uppercase letters.

Task 2: List the customer ID and first and last names for all customers located in the city of Cody. Your query should ignore case. For example, a customer with the city Cody should be included, as should customers whose city is CODYcodycOdY, and so on.

Task 3: List the customer ID, first and last names, and balance for all customers. The balance should be rounded to the nearest dollar.

Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List the INVOICE_NUM, CUST_ID, FIRST_NAME, LAST_NAME, INVOICE_DATE, and the promotion date for each invoice as PROMOTION_DATE. The promotion date is 20 days after the INVOICE_DATE was placed.
Task 5:
 Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in I_CUST_ID. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. When the procedure is called it should output the contents of I_CUSTOMER_NAME and I_CREDIT_LIMIT.

Task 6: Create the GET_INVOICE_DATE procedure to obtain the customer ID, first and last names of the customer, and the invoice date for the invoice whose number currently is stored in I_INVOICE_NUM. Place these values in the variables I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE respectively. When the procedure is called it should output the contents of I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE.

Task 7: Create the ADD_INVOICE procedure to add rows to the INVOICE table.

Task 8: Create the UPDATE_INVOICE procedure to change the date of the invoice whose number is stored in I_INVOICE_NUM to the date currently found in I_INVOICE_DATE.

Task 9: Create the DELETE_INVOICE procedure to delete the invoice whose number is stored in I_INVOICE_NUM.

Task 10: Create the ADD_COMMISSION_TRIG trigger to add the customer’s balance multiplied by the sales rep’s commission rate to the commission for the corresponding sales rep when adding a new customer.

Task 11: Create the UPD_COMMISSION_TRIG trigger to add the difference between the new balance and the old balance multiplied by the sales rep’s commission rate to the commission for the corresponding sales rep when updating a customer.

Task 12: Create the DEL_COMMISSION_TRIG trigger to subtract the balance multiplied by the sales rep’s commission rate from the commission for the corresponding sales rep when deleting a customer.

CUSTOMER table
CUST ID FIRST NAME
125
182
227
314
375
435
543
616
721
795
14219
14222
14224
14228
14231
Joey
Billy
Sandra
Samantha
Tom
INVOICES table
INVOICE NUM
14216
14233
Melanie
14237
James
Elmer
Ange
Sally
Lesle
Randy
LAST NAME
Smith
Rufton
Pincher
Smith
Rascal
Jackson
Gonzalez
Jackson
Hendricks
Cruz
Smith
Blacksmith
ADDRESS
17 Fourth St
21 Simple Cir
53 verde in
14 Rock Un
1 Rascal Farm Rd
42 Blackwater way
16 Rockway Rd
22 Jackson Farm Rd
27 Locklear Un
199 18th Ave
123 Sheepland Rd
75 Stream Rd
CITY
STATE POSTAL EMAIL
WY 82414 jsmith17@example.com
billyruff@example.com
spinch2@example.com
ssmith@example.com
trascal@example.com
mjackson5@example.com
gonzo@example.com
ejackson@example.com
Cody
Garland WY 82435
Powell WY 82440
Ralston WY 82440
Cody WY 82414
WY 82433
WY 82450
82435
82440
Elk Butte
Wapi
Garland
Powell
Dri
Ralston
Elk Butte
Cody
WY
WY
WY
WY
WY
INVOICE DATE
2021-11-15
2021-11-15
2021-11-16
2021-11-16
2021-11-18
2021-11-18
2021-11-18
2021-11-19
82440
82433
82414
ahendricks7@example.com
scruz5@example.com
smo Bexample.com
Ismith12@example.com
blacksmith@example.com
BALANCE
80.68
43.13
156.38
58.60
17.25
252.25
230.40
45.20
315.00
125
1000.00
500.00
750.00
8.33
500.00
166.65 1000.00
61.50
227
294
CUST ID
182
435
125
CREDIT LIMIT
500.00
750.00
500.00
500.00
435
250.00
616
250.00
500.00
REP ID
05
10
15
10
15
05
15
10
05
15
10
05
INVOICE_LINE table
INVOICE_NUM
14216
14219
14219
14222
14224
14228
14228
14231
14233
14233
14233
14237
ITEM table
ITEM_ID
AD72
BC33
CA75
DT12
FM23
FS39
F542
KH81
LD14
LP73
REP ID
SALES REP
05
10
15
20
DESCRIPTION
Dog Feeding Station
Feathers Bird Cage (12x24x18)
Enclosed Cat Litter Station
Dog Toy Gift Set
Fly Mask with Ears
Folding Saddle Stand
Aquarium (55 Gallon)
Wild Bird Food (25 lb)
Locking Small Dog Door
Large Pet Carrier
FIRST NAME
Daniel
Susan
Richard
Donna
LAST NAME
Garcia
Miller
Smith
Jackson
ITEM_ID
CA75
AD72
DT12
LD14
KH81
FS42
PF19
UF39
KH81
QB92
WB49
LP73
ADDRESS
42 Mountain Ln
87 Pikes Dr
312 Oak Rd
19 Lookout Dr
12
10
15
27
41
12
5
24
14
23
O
ON HAND
O
CITY
Cody
Ralston
QUANTITY
Powell
Elk Butte
3
2
4
1
4
1
1
2
1
4
4
3
STATE
WY
WY
WY
WY
CATEGORY
DOG
BRD
CAT
DOG
HOR
HOR
FSH
BRD
DOG
DOG
POSTAL
82414
82440
82440
82433
QUOTED PRICE
37.99
79.99
39.99
47.99
18.99
124.99
74.99
189.99
19.99
109.95
74.95
54.95
LOCATION
B
B
C
B
C
C
A
С
A
B
CELL PHONE
307-824-1245
307-406-4321
307-982-8401
307-883-9481
COMMISSION
12743.16
20872.11
14912.92
0.00
PRICE
79.99
79.99
39.99
39.99
24.95
39.99
124.99
19.99
49.99
59.99
RATE
0.04
0.06
0.04
0.04
O
O
E
Transcribed Image Text:CUSTOMER table CUST ID FIRST NAME 125 182 227 314 375 435 543 616 721 795 14219 14222 14224 14228 14231 Joey Billy Sandra Samantha Tom INVOICES table INVOICE NUM 14216 14233 Melanie 14237 James Elmer Ange Sally Lesle Randy LAST NAME Smith Rufton Pincher Smith Rascal Jackson Gonzalez Jackson Hendricks Cruz Smith Blacksmith ADDRESS 17 Fourth St 21 Simple Cir 53 verde in 14 Rock Un 1 Rascal Farm Rd 42 Blackwater way 16 Rockway Rd 22 Jackson Farm Rd 27 Locklear Un 199 18th Ave 123 Sheepland Rd 75 Stream Rd CITY STATE POSTAL EMAIL WY 82414 jsmith17@example.com billyruff@example.com spinch2@example.com ssmith@example.com trascal@example.com mjackson5@example.com gonzo@example.com ejackson@example.com Cody Garland WY 82435 Powell WY 82440 Ralston WY 82440 Cody WY 82414 WY 82433 WY 82450 82435 82440 Elk Butte Wapi Garland Powell Dri Ralston Elk Butte Cody WY WY WY WY WY INVOICE DATE 2021-11-15 2021-11-15 2021-11-16 2021-11-16 2021-11-18 2021-11-18 2021-11-18 2021-11-19 82440 82433 82414 ahendricks7@example.com scruz5@example.com smo Bexample.com Ismith12@example.com blacksmith@example.com BALANCE 80.68 43.13 156.38 58.60 17.25 252.25 230.40 45.20 315.00 125 1000.00 500.00 750.00 8.33 500.00 166.65 1000.00 61.50 227 294 CUST ID 182 435 125 CREDIT LIMIT 500.00 750.00 500.00 500.00 435 250.00 616 250.00 500.00 REP ID 05 10 15 10 15 05 15 10 05 15 10 05 INVOICE_LINE table INVOICE_NUM 14216 14219 14219 14222 14224 14228 14228 14231 14233 14233 14233 14237 ITEM table ITEM_ID AD72 BC33 CA75 DT12 FM23 FS39 F542 KH81 LD14 LP73 REP ID SALES REP 05 10 15 20 DESCRIPTION Dog Feeding Station Feathers Bird Cage (12x24x18) Enclosed Cat Litter Station Dog Toy Gift Set Fly Mask with Ears Folding Saddle Stand Aquarium (55 Gallon) Wild Bird Food (25 lb) Locking Small Dog Door Large Pet Carrier FIRST NAME Daniel Susan Richard Donna LAST NAME Garcia Miller Smith Jackson ITEM_ID CA75 AD72 DT12 LD14 KH81 FS42 PF19 UF39 KH81 QB92 WB49 LP73 ADDRESS 42 Mountain Ln 87 Pikes Dr 312 Oak Rd 19 Lookout Dr 12 10 15 27 41 12 5 24 14 23 O ON HAND O CITY Cody Ralston QUANTITY Powell Elk Butte 3 2 4 1 4 1 1 2 1 4 4 3 STATE WY WY WY WY CATEGORY DOG BRD CAT DOG HOR HOR FSH BRD DOG DOG POSTAL 82414 82440 82440 82433 QUOTED PRICE 37.99 79.99 39.99 47.99 18.99 124.99 74.99 189.99 19.99 109.95 74.95 54.95 LOCATION B B C B C C A С A B CELL PHONE 307-824-1245 307-406-4321 307-982-8401 307-883-9481 COMMISSION 12743.16 20872.11 14912.92 0.00 PRICE 79.99 79.99 39.99 39.99 24.95 39.99 124.99 19.99 49.99 59.99 RATE 0.04 0.06 0.04 0.04 O O E
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY