Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 (CALC_ASSIGN_CHARGE, calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS and rounded to two decimal places). Sort the results by the assignment number. The results of running that query are shown in Figure P7.5.image text in transcribedimage text in transcribed

FIGURE P7.1 THE CHO7_CONSTRUCTCO DATABASE Relational diagram AINMENT 101 I WYxo 105 Database name: Ch07_ConstructCo Table name: EMPLOYEE EMP_NUM EMPLNAME EMPFNAME ENPNTAL BMP_HREATE JOB_CODE ENP_YEARS Tiews John 06-Nov-CO 502 102 Senior David 12-Jul-89 501 103 Arbough June 01-Dec 06 500 101 Retores Arne 15 Nov 87 501 105 Johnson Alice 01Feb. 93 502 Snithfield Wilian 22-Jun-04 900 107 Alonzo Meria 10-Oct.3 900 Washington Palm 22-Aug-91 501 109 Snith Larry 18-Jul-97 901 110 Olenko Gerald 11-Dec-96 505 111 Wabash Geort 04-Apr-91 505 112 Snithson Darlene 23-Oct-S4 507 113 Joenbrood Delbert 15-Nov-96 50B Jones Annelise 20-Aug-S 500 115 Dawrangi Travis 25-Jan-S2 501 118 Pratt Gerald 05-Mar-97 510 117 Willianson Angic 19-Jun-96 909 110 Fromner Jainco 04-Jan-06 510 ime 108 W &UMANNR&a Table name: JOB 114 | JOB_CODE SUD 501 502 503 504 JOB DESCRIPTION Programmer Sysune Mat Ostase Designer Electrical Engineer Mechanical Engineer OM Engneer Clerical Support 055 ANONS Apicelone Designer e Technician Ceners Support D800 HOUR JOB LAST UPDATE 26.75 20- v-17 96.75 20hov.17 125.00 24.nr.10 84.50 20 Nov 17 67 90 20.2 .17 45.78 20-Nov-17 26.07 20 .17 45.95 18.10 24 .18 3455 20.10.12 18.36 20Nov-17 ASSN.CH 403 1005 A SSION_HOURS ASSIGN_CHAROC 295.78 149 11 8455 845 212.86 06.75 408.36 50.75 112.06 845 78.06 06.75 34.55 82.92 105 915 5413 Table name: PROJECT FROJ_NLM PROJ_NAME FROJ_VALUE Evergreen 1453500.00 Amber Wave 3600500.00 Roling Tide 5000.00 Starfight 25050000 1012 Table name: ASSIGNMENT ASSIGNUNUM ASSIGN_DATE PROJ NUWEP NUMASSION_JO 1001 22.M-18 18 1002 22- 18 22 1003 22 19 13 1004 22 -18 13 22-11-18 25 1006 22 -18 22 1007 22 M-18 25 1008 22 M -19 13 1000 25 M-10 15 1010 23 18 15 1011 23 11 25 23. 18 18 1013 23- -13 25 1014 23..18 22 1815 23. 115 1016 25 M 11 22 23. M . 10 10 1016 23 M 11 25 1019 24. Mr-13 25 1020 20. M 10 15 1021 24-Mar-18 22 1022 2018 22 24. M 1022 24.Nr.18 15 1025 20 20. .1013 PROU_BALANCE EMP_NUN 1002350 00 103 2110366 00 108 S00345 20 102 2 30988 00 107 S675 845 1995 2705 5155 588820821 105 94.55 34.55 110.5 125 105 131 26 78.01 541.45 9075 298.96 541.45 6375 278.65 1651 1105 1028 1024 045 34.55 Problem 5 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 ( CALC_ASSIGN_CHARGE , calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS and rounded to two decimal places). Sort the results by the assignment number. The results of running that query are shown in Figure P7.5. ASSIGN_NUM EMP_NUM PROJ_NUM ASSIGN_CHARGE CALC ASSIGN CHARGE 1001 103 18 295.75 295.75 1002 117 145.11 145.10999020576492 1003 117 69.1 69.0999984741211 1004 498.55 498.550008058548 103 108 1005 212.85 212.8500046133995 1006 104 406.35 406.349981546402 FIGURE P7.1 THE CHO7_CONSTRUCTCO DATABASE Relational diagram AINMENT 101 I WYxo 105 Database name: Ch07_ConstructCo Table name: EMPLOYEE EMP_NUM EMPLNAME EMPFNAME ENPNTAL BMP_HREATE JOB_CODE ENP_YEARS Tiews John 06-Nov-CO 502 102 Senior David 12-Jul-89 501 103 Arbough June 01-Dec 06 500 101 Retores Arne 15 Nov 87 501 105 Johnson Alice 01Feb. 93 502 Snithfield Wilian 22-Jun-04 900 107 Alonzo Meria 10-Oct.3 900 Washington Palm 22-Aug-91 501 109 Snith Larry 18-Jul-97 901 110 Olenko Gerald 11-Dec-96 505 111 Wabash Geort 04-Apr-91 505 112 Snithson Darlene 23-Oct-S4 507 113 Joenbrood Delbert 15-Nov-96 50B Jones Annelise 20-Aug-S 500 115 Dawrangi Travis 25-Jan-S2 501 118 Pratt Gerald 05-Mar-97 510 117 Willianson Angic 19-Jun-96 909 110 Fromner Jainco 04-Jan-06 510 ime 108 W &UMANNR&a Table name: JOB 114 | JOB_CODE SUD 501 502 503 504 JOB DESCRIPTION Programmer Sysune Mat Ostase Designer Electrical Engineer Mechanical Engineer OM Engneer Clerical Support 055 ANONS Apicelone Designer e Technician Ceners Support D800 HOUR JOB LAST UPDATE 26.75 20- v-17 96.75 20hov.17 125.00 24.nr.10 84.50 20 Nov 17 67 90 20.2 .17 45.78 20-Nov-17 26.07 20 .17 45.95 18.10 24 .18 3455 20.10.12 18.36 20Nov-17 ASSN.CH 403 1005 A SSION_HOURS ASSIGN_CHAROC 295.78 149 11 8455 845 212.86 06.75 408.36 50.75 112.06 845 78.06 06.75 34.55 82.92 105 915 5413 Table name: PROJECT FROJ_NLM PROJ_NAME FROJ_VALUE Evergreen 1453500.00 Amber Wave 3600500.00 Roling Tide 5000.00 Starfight 25050000 1012 Table name: ASSIGNMENT ASSIGNUNUM ASSIGN_DATE PROJ NUWEP NUMASSION_JO 1001 22.M-18 18 1002 22- 18 22 1003 22 19 13 1004 22 -18 13 22-11-18 25 1006 22 -18 22 1007 22 M-18 25 1008 22 M -19 13 1000 25 M-10 15 1010 23 18 15 1011 23 11 25 23. 18 18 1013 23- -13 25 1014 23..18 22 1815 23. 115 1016 25 M 11 22 23. M . 10 10 1016 23 M 11 25 1019 24. Mr-13 25 1020 20. M 10 15 1021 24-Mar-18 22 1022 2018 22 24. M 1022 24.Nr.18 15 1025 20 20. .1013 PROU_BALANCE EMP_NUN 1002350 00 103 2110366 00 108 S00345 20 102 2 30988 00 107 S675 845 1995 2705 5155 588820821 105 94.55 34.55 110.5 125 105 131 26 78.01 541.45 9075 298.96 541.45 6375 278.65 1651 1105 1028 1024 045 34.55 Problem 5 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 ( CALC_ASSIGN_CHARGE , calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS and rounded to two decimal places). Sort the results by the assignment number. The results of running that query are shown in Figure P7.5. ASSIGN_NUM EMP_NUM PROJ_NUM ASSIGN_CHARGE CALC ASSIGN CHARGE 1001 103 18 295.75 295.75 1002 117 145.11 145.10999020576492 1003 117 69.1 69.0999984741211 1004 498.55 498.550008058548 103 108 1005 212.85 212.8500046133995 1006 104 406.35 406.349981546402

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

What strategy for LMD is needed during a recession?

Answered: 1 week ago

Question

How can reflection for leaders and managers be implemented?

Answered: 1 week ago