Create a trigger named trg_cust_charge that will automatically update the CUSTOMER table’s CUS_BALANCE when a new CHARTER row is added. Use the CHARTER table’s CHAR_TOT_CHG as the update source (Assume that all charter charges are charged to the customer balance.) In addition to the CHAR_TOT_CHG, add a $5 service charge for every 50 miles flown.   Create a stored procedure to update an Aircraft’s time till maintenance. Procedure takes the Aircraft number (ac_number) as a parameter.  The procedure then resets the aircraft’s attributes: ac_ttaf to 5000, ac_ttel to 7775 and ac_tter to 8805 (right engines last longer, less stress on take offs).   Create a stored procedure that will take a Pilot’s number and percentage, then update the corresponding pilot’s annual salary by the input percentage (increase the annual salary, so you are giving the pilot a raise). Hint: you may have to do some additional work (alter table) on this one to get the table correct.

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
  • Create a trigger named trg_cust_charge that will automatically update the CUSTOMER table’s CUS_BALANCE when a new CHARTER row is added. Use the CHARTER table’s CHAR_TOT_CHG as the update source (Assume that all charter charges are charged to the customer balance.) In addition to the CHAR_TOT_CHG, add a $5 service charge for every 50 miles flown.

 

  • Create a stored procedure to update an Aircraft’s time till maintenance. Procedure takes the Aircraft number (ac_number) as a parameter.  The procedure then resets the aircraft’s attributes: ac_ttaf to 5000, ac_ttel to 7775 and ac_tter to 8805 (right engines last longer, less stress on take offs).

 

  • Create a stored procedure that will take a Pilot’s number and percentage, then update the corresponding pilot’s annual salary by the input percentage (increase the annual salary, so you are giving the pilot a raise). Hint: you may have to do some additional work (alter table) on this one to get the table correct.
Database name: Ch08_AviaCo
Table name: CHARTER
Table name: EARNEDRATING
CHAR TRIP CHAR DATE AC_NUMBER CHAR DESTINATION CHAR DISTANCE CHAR HOURS FLOWN CHAR HOURS WAIT CHAR FUEL GALLONS CHAR OL_QTS CUS CODE
10011
5.1
22
354,1
10016
10014
2.
10001 05-Feb-08 2289L
906
726
EMP NUM RTG CODE EARNRTG DATE
1.6
10002 05-Feb-08 2778V
BNA
7.8
86-99381
GNV
1574
15-Dec-05
08-Nov-93
10003 05-Feb-08 4278Y
972
101 CFI
472
6100
10004 06-Feb-08 1484P
STL
10011
10017
10012
101 NSTR
1023
5.7
35
ATL
23-Jun-94
21-Apr-93
10005 06-Feb-08 2289L
101 MEL
472
26
52
117.1
10006 06-Feb-08 4278Y
101 SEL
us
343.4
2
1574
10007 06-Feb-08 2778V
62
104 NSTR
ANO
10014
140.6
644
96 SI
SAI
GNV
29-Jan-97
10008 07-Feb-08 1484P
10017
104 MEL
66S
279.7
234
99
62
1574
104 SEL
12-Mar-95
9100
10012
768Z 00-9920 6000
32
טנר
BNA
866
352
18-Nov-97
17-Apr-95
12-Aug-95
23-Sep-94
20-Dec-95
10010 07-Feb-08 4278Y
53
664
10011 07-Feb-08 1484P
1.
42
215.1
10010
105 NSTR
10012 08-Feb-08 2778V
MOB
884
4.8
105 MEL
45
1743
10011
SAI
ATL
10013 08-Feb-08 4278Y
13S SOL
106 INSTR
6.1
2.1
10017
966
1645
10014 09-Feb-08 4278Y
6.7
459.5
10016
10015 09-Feb-08 2289L
02-Apr-96
10-Mar-94
2.
ANO
10011
10016 09-Feb-08 2778V
312
15
67 2
106 SEL
10014
10017
AOH
105.5
us
SAI
10017 10-Feb-08 1484P
3.1
05-Nov-98
805
167.4
10018 10-Feb-08 4278Y
3.8
45
LO 601
109 INSTR
Table name: CREW
Table name: CUSTOMER
96 T
15-Mar-97
109 MEL
CHAR TRIP EMP NUM CREW JOB
CUS CODE CUS LNAME CUS FNAME CUS NTIAL CUS AREACODE CUS_PHONE CUS BALANCE
109 SEL
05-Feb-96
104 Plot
844-2573
109 SES
12-May-96
LO00
10002
10010 Ramas
Alfred
A
615
000
000
896.54
101 Plot
10011 Dunne
713
894-1238
10003
105 Plot
10012 Smith
Kathy
615
894-2285
W.
Table name: RATING
109 Copilot
10013 Olowski
615
894-2180
1285.19
PO00
10005
106 Plot
673.21
1014.56
10014 Orlando
Myron
615
222-1672
RTG CODE
RTG NAME
101 Plot
10015 OBrian
713
442-3381
Certified Flight Instructor
109 Plot
9000
Jarmes
615
297-1228
000
Certified Flight Instructor, Instrument
104 Plot
UMOg 9100
290-2556
LO001
10017 Wiams
615
NSTR
Instrumert
2000
90001
105 Copilot
000
000
453.98
10018 Farriss
713
382-7185
Multiengine Land
Single Engine, Land
Single Engine, Sea
106 Plot
MEL
105 Plot
10019 Smith
Olette
615
6000
108 Plot
Table name: EMPLOYEE
SES
10011
101 Plot
10011
104 Copilat
EMP NUM EMP_ TITLE EMP LNAME EMP FNAME EMPNTIAL EMP DOB EMP HRE DATE
15-Mar-1987
25-Apr-1988 Table name: MODEL
20-Dec-1992
10012
101 Plot
100 Mr.
15-Jun-1942
10013
105 Plot
101 Ms.
Lewis
19-Mar-1965
10014
epuon
106 Plot
102 Mr,
Vandam
Rhett
14-Nov-1958
MOD CODE MOD MANUFACTURER
MOD NAME MOD SEATS MOD CHG_MILE
2.67
10015
101 Copilot
28-Aug-2005
20-Od-1996
08-Jan-2006 PA31-350 Piper
16-Oct-1974
sauor
C-90A
Beechcraft
10015
104 Piot
104 Mr.
John
08-Nov-1971
10016
105 Coplot
PA23-250 Piper
Aztec
D.
K
105 Mr.
Wiliams
Robert
14-Mar-1975
10016
Navajo Chiettain
235
Pid 601
106 Mrs.
Jeanine
12-Feb-1968
05-Jan-1991
10017
107 Mr.
Diante
21-Aug-1974
02--1996
104 Copilot
105 Plot
18-Nov-1994
14-Apr-1991
01-Dec-1992
108 Mr.
Wiesenbach Pad
14-Feb-1966
10018
R.
109 Ms.
Travis
Eizabeth
18-un-1961
110 Mrs.
Genkazi
19-May-1970
Table name: AIRCRAFT
Table name: PILOT
AC NUMBER MOD CODE AC TTAF AC TTEL AC_TTER
EMP NUM PIL LCENSE
PIL RATINGS
PL MED TYPE PL_MED_DATE PL PT135 DATE
1484P
PA23-250
1833.1
1833.1
101.8
101 ATP
ATP/SELMELinstriÇFI
11-Jan-08
17 Jan-08
02-Jan-08
02-Feb-08
20-Jan-08
1.
76827
2778V
689
1123.4
1513.1
C-90A
4243.8
104 ATP
ATP/SELMELinstr
1.
COMM/SELMELinstr/CFI
18-Dec-07
PA31-350
7992.9
789.5
105 COM
4278Y
PA31-350
80-us0
2147.3
622.1
243.2
106 COM
COMMISELMELAnstr
10-Dec-07
ATPISELMELISESAnstr/CFI 1
15-Jan-08
WOO 601
90-ue
Transcribed Image Text:Database name: Ch08_AviaCo Table name: CHARTER Table name: EARNEDRATING CHAR TRIP CHAR DATE AC_NUMBER CHAR DESTINATION CHAR DISTANCE CHAR HOURS FLOWN CHAR HOURS WAIT CHAR FUEL GALLONS CHAR OL_QTS CUS CODE 10011 5.1 22 354,1 10016 10014 2. 10001 05-Feb-08 2289L 906 726 EMP NUM RTG CODE EARNRTG DATE 1.6 10002 05-Feb-08 2778V BNA 7.8 86-99381 GNV 1574 15-Dec-05 08-Nov-93 10003 05-Feb-08 4278Y 972 101 CFI 472 6100 10004 06-Feb-08 1484P STL 10011 10017 10012 101 NSTR 1023 5.7 35 ATL 23-Jun-94 21-Apr-93 10005 06-Feb-08 2289L 101 MEL 472 26 52 117.1 10006 06-Feb-08 4278Y 101 SEL us 343.4 2 1574 10007 06-Feb-08 2778V 62 104 NSTR ANO 10014 140.6 644 96 SI SAI GNV 29-Jan-97 10008 07-Feb-08 1484P 10017 104 MEL 66S 279.7 234 99 62 1574 104 SEL 12-Mar-95 9100 10012 768Z 00-9920 6000 32 טנר BNA 866 352 18-Nov-97 17-Apr-95 12-Aug-95 23-Sep-94 20-Dec-95 10010 07-Feb-08 4278Y 53 664 10011 07-Feb-08 1484P 1. 42 215.1 10010 105 NSTR 10012 08-Feb-08 2778V MOB 884 4.8 105 MEL 45 1743 10011 SAI ATL 10013 08-Feb-08 4278Y 13S SOL 106 INSTR 6.1 2.1 10017 966 1645 10014 09-Feb-08 4278Y 6.7 459.5 10016 10015 09-Feb-08 2289L 02-Apr-96 10-Mar-94 2. ANO 10011 10016 09-Feb-08 2778V 312 15 67 2 106 SEL 10014 10017 AOH 105.5 us SAI 10017 10-Feb-08 1484P 3.1 05-Nov-98 805 167.4 10018 10-Feb-08 4278Y 3.8 45 LO 601 109 INSTR Table name: CREW Table name: CUSTOMER 96 T 15-Mar-97 109 MEL CHAR TRIP EMP NUM CREW JOB CUS CODE CUS LNAME CUS FNAME CUS NTIAL CUS AREACODE CUS_PHONE CUS BALANCE 109 SEL 05-Feb-96 104 Plot 844-2573 109 SES 12-May-96 LO00 10002 10010 Ramas Alfred A 615 000 000 896.54 101 Plot 10011 Dunne 713 894-1238 10003 105 Plot 10012 Smith Kathy 615 894-2285 W. Table name: RATING 109 Copilot 10013 Olowski 615 894-2180 1285.19 PO00 10005 106 Plot 673.21 1014.56 10014 Orlando Myron 615 222-1672 RTG CODE RTG NAME 101 Plot 10015 OBrian 713 442-3381 Certified Flight Instructor 109 Plot 9000 Jarmes 615 297-1228 000 Certified Flight Instructor, Instrument 104 Plot UMOg 9100 290-2556 LO001 10017 Wiams 615 NSTR Instrumert 2000 90001 105 Copilot 000 000 453.98 10018 Farriss 713 382-7185 Multiengine Land Single Engine, Land Single Engine, Sea 106 Plot MEL 105 Plot 10019 Smith Olette 615 6000 108 Plot Table name: EMPLOYEE SES 10011 101 Plot 10011 104 Copilat EMP NUM EMP_ TITLE EMP LNAME EMP FNAME EMPNTIAL EMP DOB EMP HRE DATE 15-Mar-1987 25-Apr-1988 Table name: MODEL 20-Dec-1992 10012 101 Plot 100 Mr. 15-Jun-1942 10013 105 Plot 101 Ms. Lewis 19-Mar-1965 10014 epuon 106 Plot 102 Mr, Vandam Rhett 14-Nov-1958 MOD CODE MOD MANUFACTURER MOD NAME MOD SEATS MOD CHG_MILE 2.67 10015 101 Copilot 28-Aug-2005 20-Od-1996 08-Jan-2006 PA31-350 Piper 16-Oct-1974 sauor C-90A Beechcraft 10015 104 Piot 104 Mr. John 08-Nov-1971 10016 105 Coplot PA23-250 Piper Aztec D. K 105 Mr. Wiliams Robert 14-Mar-1975 10016 Navajo Chiettain 235 Pid 601 106 Mrs. Jeanine 12-Feb-1968 05-Jan-1991 10017 107 Mr. Diante 21-Aug-1974 02--1996 104 Copilot 105 Plot 18-Nov-1994 14-Apr-1991 01-Dec-1992 108 Mr. Wiesenbach Pad 14-Feb-1966 10018 R. 109 Ms. Travis Eizabeth 18-un-1961 110 Mrs. Genkazi 19-May-1970 Table name: AIRCRAFT Table name: PILOT AC NUMBER MOD CODE AC TTAF AC TTEL AC_TTER EMP NUM PIL LCENSE PIL RATINGS PL MED TYPE PL_MED_DATE PL PT135 DATE 1484P PA23-250 1833.1 1833.1 101.8 101 ATP ATP/SELMELinstriÇFI 11-Jan-08 17 Jan-08 02-Jan-08 02-Feb-08 20-Jan-08 1. 76827 2778V 689 1123.4 1513.1 C-90A 4243.8 104 ATP ATP/SELMELinstr 1. COMM/SELMELinstr/CFI 18-Dec-07 PA31-350 7992.9 789.5 105 COM 4278Y PA31-350 80-us0 2147.3 622.1 243.2 106 COM COMMISELMELAnstr 10-Dec-07 ATPISELMELISESAnstr/CFI 1 15-Jan-08 WOO 601 90-ue
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

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