
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
DO THIS IN MYSQL PLEASE!
Question:
Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invoice number as a parameter. The INV_SUBTOTAL is the sum of the LINE_TOTAL amounts for the invoice, the INV_TAX is the product of the INV_SUBTOTAL and the tax rate (8 percent), and the INV_TOTAL is the sum of the INV_SUBTOTAL and the INV_TAX.

Transcribed Image Text:109 2
FIGURE P8.31 CH08_SALECO2 DATABASE TABLES
Database name: Ch08_SaleCo2
Table name: CUSTOMER
Table name: INVOICE
CUS CODE CUS_LNAME CUS_FNAME CUS_INTIAL CUS_AREACODE CUS_PHONE CUS_BALANCE
INV_NUMBER CUS_CODE INV_DATE INV_SUBTOTAL
16-Jan-18
INV_TAX INV_TOTAL
26.89
10010 Ramas
10011 Dunne
Alfred
A
K
615
713
844-2573
894-1238
894-2285
0.00
0.00
1001
10014
24.90
1.99
Leona
1002
10011
16-Jan-18
9.98
0.80
10.78
10012 Smith
Kathy
615
345.86
1003
10012
16-Jan-18
153.85
12.31
166.16
10013 Olowski
Paul
F
615
894-2180
536 75
1004
10011
17-Jan-18
34.97
2.80
37.77
Myron
Amy
10014 Orlando
615
222-1672
0.00
0.00
221. 19
768.93
1005
10018
17-Jan-18
70.44
5.64
76.08
442-3381
297-1228
10015 O'Brian
в
713
10016 Brown
James
G
615
1006
10014
17-Jan-18
397.83
31.83
429.66
George
10017 Williams
10018 Farrics
10019 Smith
615
713
290-2556
382-7185
1007
10015
17-Jan-18
34.97
2.80
37.77
Anno
G
216.65
1008
10011
17-Jan-18
399.15
31.93
431.08
Olette
K
615
297-3809
0.00
Table name: LINE
Table name: PRODUCT
INV_NUMBER LINE_NUMBER P_CODE
1 13-Q2/P2
2 23109 HB
1 54778-2T
LINE UNITS
LINE_PRICE
14.99
9.95
LINE TOTAL
P_DESCRIPT
P_INDATE P_QOH P_MIN P_PRICE P_DISCOUNT V_CODE
1001
1001
14.99
9.95
P_CODE
11QER/31 Power painter, 15 psi., 3-nozzle
13-02P2 7.25-in. pwr. saw blade
14-01A3 9.00-in, pwr, saw blade
1
03-Nov-17
5
109.99
0.00
25595
1002
4.99
9.98
13-Dec-17
32
15
14.99
0.05
21344
1003
1 2238/OPD
38.95
38.95
13-Nov-17
18
12
17.49
0.00
21344
39.95
14.99
1003
2 1546-QQ2
3 13-02/P2
1 54778-2T
2 23109-HE
1 EYC23DRT
1 SM-18277
2 2232/OTY
3 23109-HE
4 89 WRE-Q
39.95
1546-QQ2 Hrd. cloth, 1/4-in., 2x50
1558-QW1 Hrd. cloth, 1/2-in., 3x50
23119
23119
24288
15-Jan-18
15
8
39.95
0.00
1003
74.96
15-Jan-18
23
5
43.99
0.00
1004
3
4.99
14.97
2232/QTY B&D jigsaw, 12-in. blade
30-Dec-17
8
5
109.92
0.05
1004
2
9 95
19 90
2232/GME B&D jigsaw, 8-in. blade
24-Dec-17
6
99.87
0.05
24288
1005
12
5.67
70.44
2238/QPD B&D cordless drill, 1/2-in.
20-Jan-18
12
5
38.95
0.05
25595
1005
3
20.97
23109-HB Claw hammer
109 92
20-Jan-18
23
10
9.95
0.10
21225
106
23114-AA Sledge hammer, 12 lb
02-Jan-18
8
14.40
0.05
100s
9.95
9.95
1005
1007
1007
54778-2T Rat-tail file, 1/8-in. fine
15-Dec-17
0.00
21344
256.99
256.99
43
4.99
1 13-02/P2
2.54778-2T
1 PVC23DRT
2 WR/IT3
3 23103-HE
14.99
29.98
89-WRE-Q Hicut chain saw, 16 in.
07-Feb-18
11
256.99
0.05
24288
1
4 99
4 99
PVC23DRT PVC pipe, 3.5-in., 8-ft
20-Feb-18
188
75
5.87
0.00
1003
5
5.67
29.35
75
21225
SM-18277 1.25-in. metal screw, 25
SW-23116 2.5-in. wd. screw, 50
01-Mar-18
172
6.99
0.00
1008
3
119.96
359.85
24-Feb-18
237
100
8.45
0.00
21231
9 95
9 95
1008
1
VWR3/TT3 Steel matting, 4x8'x1/6", 5" mesh
17-Jan-18
18
119.95
0.10
25595
Table name: VENDOR
V CODE
21225 Bryson, Inc.
21226 SuperLoo, Inc.
21231 D&E Supply
V_NAME
V_CONTACT V AREACODE V PHONE | V_STATE V_ORDER
Smithson
615
223-3234
TN
Flushing
Singh
Ortega
Smith
904
215-8995
FL
N
228-3245
889-2546
615
TN
21344 Gomez Bros.
615
KY
N
901
901
22567 Dome Supply
23119 Randsats Lid.
24004 Brackman Bros.
24288 ORDVA, Inc.
25443 B&K, Inc.
25501 Damal Supplies
25595 Rubicon Systems Orton
678-1419
GA
N
Anderson
678-3998
GA
Browning
Hakford
615
228-1410
TN
615
898-1234
TN
Smith
904
227-0093
FL
N
Smythe
615
890-3529
TN
456-0092
FL
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
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
- 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.arrow_forwardTask 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)arrow_forwardSQL CODE FOR For the players who show up in Batting, Bowling, and Fielding tables, create a list that shows their names, runs they have scored, wickets they have taken, and catches they have taken? table is in picture (bowling table is same as batting and fielding )arrow_forward
- Do this in MySQL please: Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invoice number as a parameter. The INV_SUBTOTAL is the sum of the LINE_TOTAL amounts for the invoice, the INV_TAX is the product of the INV_SUBTOTAL and the tax rate (8 percent), and the INV_TOTAL is the sum of the INV_SUBTOTAL and the INV_TAX.arrow_forwardWrite a stored procedure called sp_apply_discount() that will apply percent discount to books in a subject. The stored procedure takes in 2 parameters, percentDiscount (DECIMAL(8,2)) and subject (VARCHAR(120)). Using these parameters, the stored procedure computes the discount for the book cost and stores it in the FINAL_PRICE field. For example, the following stored procedure call: call sp_apply_discount(0.15, 'Database');would compute 15% percent discount from the book cost in the Database subject category and store it in the FINAL_PRICE column as depicted in this image:arrow_forwardRichardson Ski Racing (RSR) sells equipment needed for downhill ski racing. One of RSR's products is fencing used on downhill courses. The fence product comes in 150-foot rolls and sells for $215 per roll. However, RSR offers quantity discounts. The following table shows the price per roll depending on order size: Quantity Ordered To Price per Roll From 1 70 $215 71 140 $195 141 280 $175 281 and up $155 Click on the datafile logo to reference the data. DATA file (a) Use the VLOOKUP function with the preceding pricing table to determine the total revenue from these orders. (b) Use the COUNTIF function to determine the number of orders in each price bin. From Number of To Price per Roll 70 $215 !!! 140 $195 280 $175 and up $155 1 71 141 281 Orders 172arrow_forward
- Write a PL/SQL stored procedure to print number of employees who are working in a job with Title "Tester". Include procedure call also. If the total count of Employees is more than 5 then print "Sufficient number of Employees" If the total count of Employees is less than 5 then print "Insufficient number of Employees" Else print "there are 5 employees". Use Oracle's NO DATA_FOUND build in exception to display the last message. DEPARTMENTS LOCATIONS P DEPARTMENT_ID * DEPARTMENT_NAME MANAGER_ID LOCATION_ID P LOCATION_ID STREET ADDRESS POSTAL_CODE * CITY STATE PROVINCE COUNTRY_ID JOB_HISTORY PF* EMPLOYEE_ID P * START DATE * END DATE F JOB ID F DEPARTMENT_ID EMPLOYEES P EMPLOYEE_ID FIRST NAME * LAST_NAME EMAIL COUNTRIES COUNTRY_ID COUNTRY_NAME F REGION ID PHONE_NUMBER * HIRE DATE F JOB_ID JOBS P JOB_ID * JOB_TITLE MIN_SALARY MAX_SALARY SALARY COMMISSION_PCT MANAGER_ID F REGIONS DEPARTMENT_ID P* REGION_ID REGION_NAME I--arrow_forwardQuery 3: Write a parameter query to display the names of all prospects each member tried to recruit based on the member’s first name and the member’s last name you input. List the member’s First Name, member’s Last Name, prospect’s First Name, and prospect’s Last Name (in this order in the query grid). Display the member’s First Name Heading as Member First Name, member’s Last Name Heading as Member Last Name, prospect’s first name heading as Prospect First Name, and prospect’s last name heading as Prospect Last Name. Sort the list by Member Last Name, Member First Name, Prospect Last Name, and Prospect First Name, all ascending order. (WE ARE USING ACCESS SO I AM JUST TRYING TO UNDERSTAND WHAT TO PUT AND PLUG IN ETC. USE MY PICTURES AS REFERRENCE!)arrow_forwardthe employee table have the following . ask user what is the employee_id and how much employee wants to contribute 2 substitutions variable from end user &emp_id &contribution_amount If employee salary is in between $1000-$3999 And if employee's contribution amount is less than $100 then company match $100 if employee's contribution amount is greater than 100 but less than $200 then company match $75 if employee's contribution amount is greater than $200 then company match $50 $4000-$6999 And if employee's contribution amount is less than $100 then company match $150 if employee's contribution amount is greater than 100 but less than $200 then company match $100 if employee's contribution amount is greater than $200 then company match $75 $7000-$12000And if employee's contribution amount is less than $100 then company match $200 if employee's contribution amount is greater than…arrow_forward
- Write a SELECT statement returns these columns from the orders table: The invoice_id column as Invoice_ID The invoice_date column as Invoice_Date The invoice_due_date column as Invoice_Due_Date The payment_date column in the format 'Mon/DD/YY' as Formatted_Payment_Date The invoice_due_date column in the format 'Weekday, Month Day of month with suffix, YYYY' (ex: 'Tuesday, April 23rd, 2019') as Long_Invoice_Due_Date The invoice_due_date plus 60 days as Expected_Payment_Date (Column must remain a date type) The number of days between the invoice_due_date and the payment_date as Time_To_Payarrow_forwardTask 12: When deleting a customer, subtract the balance multiplied by the sales rep’s commission rate from the commission for the corresponding sales rep.arrow_forwardQ1. Write a SELECT statement that returns these columns from the Invoices table: The invoice _total column A column that uses the ROUND function to return the invoice_total column with 1 decimal digit A column that uses the ROUND function to return the invoice_total column with no decimal digits Q1. Write a SELECT statement that returns these columns from the Invoices table: • The invoice_total column • A column that uses the ROUND function to return the invoice_total column with 1 decimal digit • A column that uses the ROUND function to return the invoice_total column with no decimal digits invoice_total one digit 3813.33 3813.3 zero_digits 3813arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education