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.  (mySQL)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

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.  (mySQL)

CUST_ID FIRST_NAME LAST_NAME ADDRESS
125
182
227
294
314
375
435
492
543
616
721
795
Joey
Billy
Sandra
Samantha
Tom
Melanie
James
Elmer
Angie
Sally
Leslie
Randy
Smith
Rufton
Pincher
Smith
Rascal
Jackson
Gonzalez
Jackson
Hendricks
Cruz
Smith
Blacksmith
17 Fourth St
21 Simple Cir
53 Verde Ln
14 Rock Ln
1 Rascal Farm Rd
42 Blackwater Way
16 Rockway Rd
22 Jackson Farm Rd
27 Locklear Ln
199 18th Ave
123 Sheepland Rd
75 Stream Rd
CITY
Cody
Garland
Powell
Ralston
Cody
Elk Butte
Wapiti
Garland
Powell
Ralston
Elk Butte
Cody
STATE POSTAL
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
82414
82435
82440
82440
82414
82433
82450
82435
82440
82440
82433
82414
EMAIL
jsmith17@example.com
billyruff@example.com
spinch2@example.com
ssmith5@example.com
trascal3@example.com
mjackson5@example.com
jgonzo@example.com
ejackson4@example.com
ahendricks7@example.com
scruz5@example.com
Ismith12@example.com
rblacksmith6@example.com
BALANCE
80.68
43.13
156.38
58.60
17.25
252.25
230.40
45.20
315.00
8.33
166.65
61.50
CREDIT_LIMIT REP_ID
500.00
750.00
500.00
500.00
250.00
250.00
1000.00
500.00
750.00
500.00
1000.00
500.00
05
10
15
10
15
05
15
10
05
15
10
05
Transcribed Image Text:CUST_ID FIRST_NAME LAST_NAME ADDRESS 125 182 227 294 314 375 435 492 543 616 721 795 Joey Billy Sandra Samantha Tom Melanie James Elmer Angie Sally Leslie Randy Smith Rufton Pincher Smith Rascal Jackson Gonzalez Jackson Hendricks Cruz Smith Blacksmith 17 Fourth St 21 Simple Cir 53 Verde Ln 14 Rock Ln 1 Rascal Farm Rd 42 Blackwater Way 16 Rockway Rd 22 Jackson Farm Rd 27 Locklear Ln 199 18th Ave 123 Sheepland Rd 75 Stream Rd CITY Cody Garland Powell Ralston Cody Elk Butte Wapiti Garland Powell Ralston Elk Butte Cody STATE POSTAL WY WY WY WY WY WY WY WY WY WY WY WY 82414 82435 82440 82440 82414 82433 82450 82435 82440 82440 82433 82414 EMAIL jsmith17@example.com billyruff@example.com spinch2@example.com ssmith5@example.com trascal3@example.com mjackson5@example.com jgonzo@example.com ejackson4@example.com ahendricks7@example.com scruz5@example.com Ismith12@example.com rblacksmith6@example.com BALANCE 80.68 43.13 156.38 58.60 17.25 252.25 230.40 45.20 315.00 8.33 166.65 61.50 CREDIT_LIMIT REP_ID 500.00 750.00 500.00 500.00 250.00 250.00 1000.00 500.00 750.00 500.00 1000.00 500.00 05 10 15 10 15 05 15 10 05 15 10 05
INVOICE_NUM
14216
14219
14222
14224
14228
14231
14233
14237
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
CUST_ID
125
227
294
182
435
125
435
616
Transcribed Image Text:INVOICE_NUM 14216 14219 14222 14224 14228 14231 14233 14237 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 CUST_ID 125 227 294 182 435 125 435 616
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Didn't return any results, therefore the code is incorrect. 

Lab 8-1: KimTay Pet Supplies
Tasks
!!!
3
CENGAGE MINDTAP
순
0.00
out of
10.00
Task 4: Kim Tay Pet Supplies is running a promotion that is valid for up to 20 days...
Task 5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and c...
>
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.
Checks
O out of 1 checks passed. Review the results below for more details.
SQL Database Test Incomplete
Complete task 6
Feedback
The wrong headers were returned.
Some expected rows were missing (shown in red below).
Test Query
227
CALL GET INVOICE_DATE('14219')
Expected Results
I_CUST_ID
Actual Results Ⓡ
No data
I_CUST_NAME
Sandra Pincher
I_INVOICE_DATE
>
2021-11-15
FILETREE
~/workspace
query.sql
query2.sql
query.sql
X query2.sql
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 END //
27
28 Delimiter ;
29
30 CALL GET_INVOICE_DATE('14219');
31
DECLARE I_CUST_ID INT(6);
DECLARE I_CUST_NAME VARCHAR (50);
DECLARE I_INVOICE_DATE DATE;
SELECT c.CUST_ID, CONCAT (c.FIRST_NAME, ', c.LAST_NAME),
FROM INVOICES i
INNER JOIN CUSTOMER C
X +
INTO I_CUST_ID, I_CUST_NAME, I_INVOICE_DATE
ON i.CUST_ID = c.CUST_ID
SQL Viewer
WHERE i. INVOICE_NUM = I_INVOICE_NUM;
X >_ Terminal
I
+
i. INVOICE_DATE
Query completed
Q Search this course
i
?
A-Z
Transcribed Image Text:Lab 8-1: KimTay Pet Supplies Tasks !!! 3 CENGAGE MINDTAP 순 0.00 out of 10.00 Task 4: Kim Tay Pet Supplies is running a promotion that is valid for up to 20 days... Task 5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and c... > 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. Checks O out of 1 checks passed. Review the results below for more details. SQL Database Test Incomplete Complete task 6 Feedback The wrong headers were returned. Some expected rows were missing (shown in red below). Test Query 227 CALL GET INVOICE_DATE('14219') Expected Results I_CUST_ID Actual Results Ⓡ No data I_CUST_NAME Sandra Pincher I_INVOICE_DATE > 2021-11-15 FILETREE ~/workspace query.sql query2.sql query.sql X query2.sql 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 END // 27 28 Delimiter ; 29 30 CALL GET_INVOICE_DATE('14219'); 31 DECLARE I_CUST_ID INT(6); DECLARE I_CUST_NAME VARCHAR (50); DECLARE I_INVOICE_DATE DATE; SELECT c.CUST_ID, CONCAT (c.FIRST_NAME, ', c.LAST_NAME), FROM INVOICES i INNER JOIN CUSTOMER C X + INTO I_CUST_ID, I_CUST_NAME, I_INVOICE_DATE ON i.CUST_ID = c.CUST_ID SQL Viewer WHERE i. INVOICE_NUM = I_INVOICE_NUM; X >_ Terminal I + i. INVOICE_DATE Query completed Q Search this course i ? A-Z
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education