Question: 2- Consider the following database. stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each

2- Consider the following database. stores data2- Consider the following database. stores data

2- Consider the following database. stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. Relational diagram 111 Jones CICO Table name: EMPLOYEE ASUNEN EMP_NUM EMP_LNAME EMP_FNAME EMP_INTIAL EMP_FREDATE JOB_CODE EMP_YEARS PC a um AN 101 News John G 08.Nov.00 502 17 Ang Dute 102 Senior David EMPLOYEE H 12-Jul-89 501 28 100 RO Pretum 103 Arbough June E 01-Dec-96 500 Tempur 21 Pb Code PtNum Antigo PRECT 104 Ramoras Anne K 15-Nov-87 501 30 -HO Design my Name ALOH. te mane 105 Ano Johnson Alice K 01-Feb-93 502 25 ob Chemor Mont Update Pr Name 106 Smithfield William 22-Jun-04 500 13 mere Pre Value Code 107 Pro Alonzo Maria D 10-Oct-93 500 24 Emer mpum 108 Washington Ralph B 22-Aug-91 501 26 109 Smith Larry w 18-Jul-97 501 20 110 Olenko Gerald A 11-Dec-95 505 22 Wabash Geott 04-Apr-91 506 27 112 Smithson Darlene 23-Oct-94 507 23 113 Joenbrood Delbert 15-Nov-96 508 21 Table name: JOB 114 Annelise 20-Aug-93 508 24 115 Bawangi Travis 25-Jan-92 501 26 JOB_CODEJCB_DESCRPTION_CHO_MOUR JOB_LAST_UPDATE 116 Pratt Gerald 05-Mar-97 510 21 500 Programmer 35.75 20-Nov17 117 Williamson Angie 501 19-Jun-96 509 21 Systems Analyst 96.75 20-Nov.17 502 Database Designer 125.00 24. Mr.18 118 Frommer James 04-Jan-05 510 13 500 Blectrical Engineer 8450 20-Nov-17 504 Mechanical Engineer 67 90 20-Nov-17 Table name: ASSIGNMENT 505 CMI Engineer 5570 20-Nov-17 506 ASSIONMUM ASSION_DATE FROM_NUM EMP_NUM ASSION_ID ASSION_CHO_JR ASSION_HOURS ASSIGN_CHAROE Clerical Support 25 87 20-Nov-17 1001 100 900 22-Mar18 10 645 3.5 29575 507 DSS Analyst 45 95 20-Nov.17 1002 22-Mar-18 22 117 S09 34 55 42 145.11 500 Applications Designer 48.10 24. Mr.10 1003 22-Mar-18 10 117 509 3455 2 691 509 Bio Technician 3455 20.Nov.17 1004 22- M101 103 503 645 59 43855 510 General Support 18.36 20-Nov-17 1005 22-Mar-18 25 100 500 96.75 22 21255 100% 22.10 22 104 500 965 42 405 35 1007 22-Mar-18 25 113 SOB 50.75 3.8 19285 1000 22.18 18 103 500 045 09 7505 1009 25-Mar-18 15 115 501 6675 5.6 5410 1010 2.18 15 117 509 3455 24 82.92 1011 PROJ_NUM PROJ_NAME PROU VALUE PROJ BALANCE EMP NEM . 23-11025 109 502 105 43 4515 1012 108 501 23.18 18 15 34 145350000 Evergreen 1002350 00 103 9875 1013 23. Mr.10 25 115 500 96.75 2 1905 18 Amber Wave 350050000 2110346.00 108 1014 23-Mar-18 22 104 505 9675 20 2709 22 Rolling Tide 805000.00 500345 20 102 1015 23.1.18 15 100 500 045 61 515.45 25 Starfight 265050000 230988000 107 1016 23-10 22 105 503 105 4.7 4935 1017 23-Mar-18 18 117 509 3455 38 13129 1018 23-1.18 25 117 SOS 34 55 22 78 01 1019 24.18 25 104 500 1105 49 54145 1020 24. Mr.18 15 101 502 126 3.1 3875 1021 24-Mar-18 22 100 1901 1105 27 290 35 1022 24.18 22 115 Sot 1105 49 541 45 1023 24.18 22 105 502 125 35 4375 1024 24- M18 15 103 503 845 33 27885 1095 2. Mar. 1818 117 500 3455 42 14511 Table name: PROJECT a) Write the SQL code that will list only the distinct project numbers in the ASSIGNMENT table, sorted by project number. b) 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. c) 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!