6. Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query should retrieve the assignment number, employee number, project number, the stored assignment charge (ASSIGN_CHARGE), and the calculated assignment charge (calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS). Sort the results by the assignment number. 7. Using the data in the ASSIGNMENT table, write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked, sorted by employee number. The result of running that query is shown below: EMP_NUM EMP LNAME SumOtASSIGN_HOURS SumOtASSIGN CHARGE News 3.1 387.50 1664.65 1218.70 101 Arbough Ramoras 103 19.7 11.9 12.5 8.3 3.8 12.5 18.8 104 105 Johnson 1382.50 Washington Joenbrood Bawangi Williamson 108 840. 15 192.85 1276.75 649.54 113 115 117

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
6. Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your
query should retrieve the assignment number, employee number, project number, the stored
assignment charge (ASSIGN_CHARGE), and the calculated assignment charge (calculated by
multiplying ASSIGN_CHG_HR by ASSIGN_HOURS). Sort the results by the assignment number.
7. Using the data in the ASSIGNMENT table, write the SQL code that will yield the total number of hours
worked for each employee and the total charges stemming from those hours worked, sorted by
employee number. The result of running that query is shown below:
EMP_NUM EMP LNAME SumOfASSIGN_HOURS SumOfASSIGN CHARGE
101
News
3.1
387.50
Arbough
19.7
11.9
12.5
8.3
3.8
103
1664.65
104
Ramoras
1218.70
105
Johnson
1382. 50
Washington
840.15
192.85
1276.75
108
113
Joenbrood
115
117
Bawangi
Williamson
12.5
18.8
649.54
Transcribed Image Text:6. Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query should retrieve the assignment number, employee number, project number, the stored assignment charge (ASSIGN_CHARGE), and the calculated assignment charge (calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS). Sort the results by the assignment number. 7. Using the data in the ASSIGNMENT table, write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked, sorted by employee number. The result of running that query is shown below: EMP_NUM EMP LNAME SumOfASSIGN_HOURS SumOfASSIGN CHARGE 101 News 3.1 387.50 Arbough 19.7 11.9 12.5 8.3 3.8 103 1664.65 104 Ramoras 1218.70 105 Johnson 1382. 50 Washington 840.15 192.85 1276.75 108 113 Joenbrood 115 117 Bawangi Williamson 12.5 18.8 649.54
1. Table : ASSIGNMENT
2. TABLE: EMPLOYEE
E EMPLOYEE
E ASSIGNMENT
EMP NU . EMP LNAM - EMP FNAM - EMP INITIA - EMP HIREDAT JOB COL - EMP YEAI -
4101
- 102
E 103
ASSIGN_NUM - ASSIGN_DATE. PROJ_NUM . EMP_NUM . ASSIGN_JOB . ASSIGN_CHG_HR
- ASSIGN_CHARGE.
295.75
ASSIGN_HOURS
News
Senior
G
08-Nov-00 502
12 Jul-89 501
01-Dec-96 503
John
6.
1001
22-Mar-14 18
103
503
84.50
3.5
David
H.
17
1002
22-Mar-14 22
117
509
34 55
4.2
145.11
1003
22-Mar-14 18
117
509
34.55
2.0
69.10
Arbough
June
E
10
1004
22-Mar 14 18
103
503
84.50
5.9
498.55
- 104
Ramoras
Anne
K
15-Nov-87 501
19
- 105
+ 106
O 107
- 108
Johnson
Smithfield
Alonzo
Washington
Alice
William
1005
K
01-Feb-93 502
14
22-Mar-14 25
22-Mar-14 22
22 Mar-14 25
108
501
96.75
96.75
22
212.85
406.35
1006
104
501
4.2
22-Jun-04 500
2
1007
113
508
50 75
38
192 85
Maria
D
10-Oct-93 500
13
1008
22-Mar-14 18
103
503
84.50
0.9
70.05
Ralph
Larry
22-Aug-91 501
18-Jul-97 501
B
15
1009
23-Mar-14 15
115
501
96 75
5.6
541.80
+ 109
- 110
- 111
+ 112
Smith
9
1010
23 Mar-14 15
117
509
34.55
2.4
82.92
Olenko
Wabash
1011
23-Mar.14 25
105
502
105.00
4.3
451.50
Gerald
11-Dec-95 505
11
04-Apr-91 506
23-Oct-94 507
1012
23-Mar-14 18
108
501
96.75
3.4
328.95
Geoff
B
15
193.50
270.90
1013
23-Mar-14 25
115
501
96.75
2.0
Smithson
Darlene
12
1014
23-Mar-14 22
104
501
98.75
2.8
113
Joenbrood
Delbert
K
15-Nov-96 508
10
1015
23-Mar-14 15
103
503
84.50
0.1
515.45
- 114
E 115
4 116
Jones
Annelise
20-Aug-93 508
13
1016
23-Mar-14 22
105
502
105.00
4.7
493.50
Bawangi
Travis
B
25-Jan-92 501
15
23-Mar-14 18
23 Mar-14 25
1017
117
509
34.55
3.8
131.29
Gerald
Angie
1018
117
509
34.55
22
76.01
Pratt
05-Mar-97 510
10
19-Jun-96 509
24-Mar-14 25
24-Mar-14 15
24-Mar-14 22
24-Mar-14 22
1019
104
501
110.50
4.9
541.45
国117
Williamson
10
1020
101
502
125.00
3.1
387.50
- 118
Frommer
James
04-Jan-05 510
2
1021
108
501
110.50
2.7
298.35
1022
115
501
110.50
4.9
541.45
437.50
278. 85
1023
24-Mar-14 22
105
502
125.00
3.5
1024
24-Mar-14 15
103
503
84.50
3.3
1025
24-Mar-14 10
117
509
34.55
4.2
145.11
3. TABLE: JOB
曲 IOR
JOB
JOB_COI . JOB DESCRIPTION- JOE CHO_HOL - JOB_LAST_UPDA -
+500
+ 501
35.75
Programmer
Syslems Analyst
Database Designer
Electical Engineer
Mecharical Engineer
Civil Engineer
Clerical Support
DSS Analyst
Applications Designer
Bio Technician
General Support
20-Nov-13
4. TABLE: PROJECT
90.75
20-Nuv-13
+ 502
125.00
24-Mar-14
田 503
+ 504
I PROJECT
PROJ_NL. PROJ_NAME . PROJ_VALUE . PROJ_BALANC. EMP_NU.
84.50
20-Nav-13
67.90
20-Nov-13
+505
55.78
20-Nov-13
Cvergreon
1453500.00
1002350.00 103
2110346.00 108
+ 506
26.87
20 Nov 13
+ 18
O 22
+ 25
Amber Wave
3500500.00
+ 507
4 508
+ 509
4 510
45.95
20-Nov-13
Roling Tide
805000.00
500345.20 102
24-Mar- 14
20-Nov-13
20-Nov-13
48.10
Starfight
2650500.00
2309880.00 107
34.55
18.36
Transcribed Image Text:1. Table : ASSIGNMENT 2. TABLE: EMPLOYEE E EMPLOYEE E ASSIGNMENT EMP NU . EMP LNAM - EMP FNAM - EMP INITIA - EMP HIREDAT JOB COL - EMP YEAI - 4101 - 102 E 103 ASSIGN_NUM - ASSIGN_DATE. PROJ_NUM . EMP_NUM . ASSIGN_JOB . ASSIGN_CHG_HR - ASSIGN_CHARGE. 295.75 ASSIGN_HOURS News Senior G 08-Nov-00 502 12 Jul-89 501 01-Dec-96 503 John 6. 1001 22-Mar-14 18 103 503 84.50 3.5 David H. 17 1002 22-Mar-14 22 117 509 34 55 4.2 145.11 1003 22-Mar-14 18 117 509 34.55 2.0 69.10 Arbough June E 10 1004 22-Mar 14 18 103 503 84.50 5.9 498.55 - 104 Ramoras Anne K 15-Nov-87 501 19 - 105 + 106 O 107 - 108 Johnson Smithfield Alonzo Washington Alice William 1005 K 01-Feb-93 502 14 22-Mar-14 25 22-Mar-14 22 22 Mar-14 25 108 501 96.75 96.75 22 212.85 406.35 1006 104 501 4.2 22-Jun-04 500 2 1007 113 508 50 75 38 192 85 Maria D 10-Oct-93 500 13 1008 22-Mar-14 18 103 503 84.50 0.9 70.05 Ralph Larry 22-Aug-91 501 18-Jul-97 501 B 15 1009 23-Mar-14 15 115 501 96 75 5.6 541.80 + 109 - 110 - 111 + 112 Smith 9 1010 23 Mar-14 15 117 509 34.55 2.4 82.92 Olenko Wabash 1011 23-Mar.14 25 105 502 105.00 4.3 451.50 Gerald 11-Dec-95 505 11 04-Apr-91 506 23-Oct-94 507 1012 23-Mar-14 18 108 501 96.75 3.4 328.95 Geoff B 15 193.50 270.90 1013 23-Mar-14 25 115 501 96.75 2.0 Smithson Darlene 12 1014 23-Mar-14 22 104 501 98.75 2.8 113 Joenbrood Delbert K 15-Nov-96 508 10 1015 23-Mar-14 15 103 503 84.50 0.1 515.45 - 114 E 115 4 116 Jones Annelise 20-Aug-93 508 13 1016 23-Mar-14 22 105 502 105.00 4.7 493.50 Bawangi Travis B 25-Jan-92 501 15 23-Mar-14 18 23 Mar-14 25 1017 117 509 34.55 3.8 131.29 Gerald Angie 1018 117 509 34.55 22 76.01 Pratt 05-Mar-97 510 10 19-Jun-96 509 24-Mar-14 25 24-Mar-14 15 24-Mar-14 22 24-Mar-14 22 1019 104 501 110.50 4.9 541.45 国117 Williamson 10 1020 101 502 125.00 3.1 387.50 - 118 Frommer James 04-Jan-05 510 2 1021 108 501 110.50 2.7 298.35 1022 115 501 110.50 4.9 541.45 437.50 278. 85 1023 24-Mar-14 22 105 502 125.00 3.5 1024 24-Mar-14 15 103 503 84.50 3.3 1025 24-Mar-14 10 117 509 34.55 4.2 145.11 3. TABLE: JOB 曲 IOR JOB JOB_COI . JOB DESCRIPTION- JOE CHO_HOL - JOB_LAST_UPDA - +500 + 501 35.75 Programmer Syslems Analyst Database Designer Electical Engineer Mecharical Engineer Civil Engineer Clerical Support DSS Analyst Applications Designer Bio Technician General Support 20-Nov-13 4. TABLE: PROJECT 90.75 20-Nuv-13 + 502 125.00 24-Mar-14 田 503 + 504 I PROJECT PROJ_NL. PROJ_NAME . PROJ_VALUE . PROJ_BALANC. EMP_NU. 84.50 20-Nav-13 67.90 20-Nov-13 +505 55.78 20-Nov-13 Cvergreon 1453500.00 1002350.00 103 2110346.00 108 + 506 26.87 20 Nov 13 + 18 O 22 + 25 Amber Wave 3500500.00 + 507 4 508 + 509 4 510 45.95 20-Nov-13 Roling Tide 805000.00 500345.20 102 24-Mar- 14 20-Nov-13 20-Nov-13 48.10 Starfight 2650500.00 2309880.00 107 34.55 18.36
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
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