Write a query to produce the total number of hours round to 1 digit and charges round to  2 digits for each of the projects represented in the ASSIGNMENT table, sorted by project number.  In the SQL Query do the following  Select clause: Proj_Num, sum of Assign_hours rounded to 1 place, sum of  Assign_charge rounded to 2 places (You will be using SUM and ROUND to achieve the  intended result)  From: ASSIGNMENT  Where clause: not needed because we are not restricting anything here Group by clause: project number column.   Since we are using sum to calculate total number of hours and total charges we have to use group by clause for the columns that are not involved in the calculation which is project number column.

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

Write a query to produce the total number of hours round to 1 digit and charges round to  2 digits for each of the projects represented in the ASSIGNMENT table, sorted by project number. 

In the SQL Query do the following 

Select clause: Proj_Num, sum of Assign_hours rounded to 1 place, sum of  Assign_charge rounded to 2 places (You will be using SUM and ROUND to achieve the  intended result) 

From: ASSIGNMENT 

Where clause: not needed because we are not restricting anything here Group by clause: project number column.  

Since we are using sum to calculate total number of hours and total charges we have to use group by clause for the columns that are not involved in the calculation which is project number column.

FIGURE P7.1 THE CH07_CONSTRUCTCO DATABASE
Database name: Ch07_ConstructCo
Relational diagram
Table name: EMPLOYEE
EMP NUM EMP LNAME EMP FNAME ENP_NITIAL BMP_HIREDATE JOe_CODE EMP_VEARS
ASSGNMENT
101
Newa
John
06-Nov-00 502
17
Serior
David
Agn ate
F2 PrNum
Fa num
102
H
12 Jul 80 601
28
EMPLOEE
103
01-Deo 06 600
Arbough
Remoree
June
E
21
*a Code
* ma.Nam
PRONCT
104
Arne
K
15. Nov.87 501
30
a Destiptien
b Ch Hour
Aen O O--H rNu
Aign ur
Aign. Cage
01-Feb 93 602
22-n.04 S00
105
Johnson
Alice
K
25
m nt
rNume
PrValue
Prej Blance
FR mNum
106
Snithield
Wilian
13
107
Alonzo
Marin
10-oct.3 S00
24
P Code
E Year
Washington Raph
Snth
22-Aug-91 501
18Jul-S7 S01
108
25
109
Larry
20
110
111
Olenko
Gerald
A
11-Dec-S5 505
22
Wabash
Geort
04-Apr-91 S05
27
112
Snthson
Darlene
23-Oct-94 507
23
Debert
Amelse
113
Joentrood
K
15-Nov-S6 508
21
Table name: JOB
Jones
114
20-Aug-S3 50s
24
115
Dewengi
Prat
Travis
25-len-S2 501
20
JO8 CODE OE DESORPTON JCE OO HOLR KE LAST UPDATE
115
Ger ald
05-Mar-S7 510
21
Progerme
Systens Anavst
3575
204o-17
117
Wlianson
Arge
H
19-Jun-00 c09
21
96.75
20-17
110
Fronner
James
04-Jon-C6 S10
13
Detinbase Designer
Eucroalrah
12500
24--10
503
504
506
500
507
8450
20ov-17
Table name: ASSIGNMENT
Mecherca Engive
OMEngner
Oerkcal Suppot
05S Ay
Apskene Deslarer
6790
20-17
55 78
20o-17
ASSOUNUM ASSIGN DATE POJLM EPNN ASN KE ASSIGN CHO ASSN HOURS ASN CAR
2047
20N-17
22-1 18
108
845
35
216 7
4595
48.10
20o-17
22a-1 22
117
34.55
42
145 11
24-Mar-18
22-M-1 18
34 55
2
Be Technem
3455
20io17
845
1004
22-a-18 18
108
108
603
53
510
Cenard Suort
18.36
20ov-17
1006
22-M-18 25
601
06.75
22
212.86
1006
22--18 22
22M-18 25
22 M-1 18
104
501
06.75
42
406.36
113
100
50.75
33
03
132 86
78.06
1000
1000
23-M-18 15
115
501
06.75
55
5418
Table name: PROJECT
FROJ_NLM PROJ_NAME
Evergreen
21-18 15
117
509
54.55
24
1011
21-18 25
106
105
6.75
Se.75
4.3
FROJ_VALUE
1453500.00
PROJ_BALANCE EMP_NUM
1002350 00 103
2110346 00 108
23 M.1 18
21-1 25
23N1 22
23M1 15
328.
1012
1013
108
115
501
501
34
15
1635
18
Anber Wave
350OS00.00
1014
104
501
96.75
23
2709
Roing nde
Starfigrt
22
SI345 20 102
1015
1010
105
503
002
845
106
6.1
47
515 45
25
eso500 o0
230seR0 00 107
21 Me-10 22
106
1017
21M10 10
21M-10 25
117
09
54.55
33
121 29
1010
1019
117
009
54.55
110.5
22
43
78.01
5e1.45
24Me-10 25
104
001
1120
24M-19 15
101
125
3.1
307
1021
24M-10 22
100
01
1105
1105
27
280.36
24.M-10 22
115
01
49
51.45
1029
24 M-10 22
105
125
35
4375
24M-10 1S
1124
1126
100
04.5
54.55
33
270.00
24 M-10 10
117
42
145.11
Transcribed Image Text:FIGURE P7.1 THE CH07_CONSTRUCTCO DATABASE Database name: Ch07_ConstructCo Relational diagram Table name: EMPLOYEE EMP NUM EMP LNAME EMP FNAME ENP_NITIAL BMP_HIREDATE JOe_CODE EMP_VEARS ASSGNMENT 101 Newa John 06-Nov-00 502 17 Serior David Agn ate F2 PrNum Fa num 102 H 12 Jul 80 601 28 EMPLOEE 103 01-Deo 06 600 Arbough Remoree June E 21 *a Code * ma.Nam PRONCT 104 Arne K 15. Nov.87 501 30 a Destiptien b Ch Hour Aen O O--H rNu Aign ur Aign. Cage 01-Feb 93 602 22-n.04 S00 105 Johnson Alice K 25 m nt rNume PrValue Prej Blance FR mNum 106 Snithield Wilian 13 107 Alonzo Marin 10-oct.3 S00 24 P Code E Year Washington Raph Snth 22-Aug-91 501 18Jul-S7 S01 108 25 109 Larry 20 110 111 Olenko Gerald A 11-Dec-S5 505 22 Wabash Geort 04-Apr-91 S05 27 112 Snthson Darlene 23-Oct-94 507 23 Debert Amelse 113 Joentrood K 15-Nov-S6 508 21 Table name: JOB Jones 114 20-Aug-S3 50s 24 115 Dewengi Prat Travis 25-len-S2 501 20 JO8 CODE OE DESORPTON JCE OO HOLR KE LAST UPDATE 115 Ger ald 05-Mar-S7 510 21 Progerme Systens Anavst 3575 204o-17 117 Wlianson Arge H 19-Jun-00 c09 21 96.75 20-17 110 Fronner James 04-Jon-C6 S10 13 Detinbase Designer Eucroalrah 12500 24--10 503 504 506 500 507 8450 20ov-17 Table name: ASSIGNMENT Mecherca Engive OMEngner Oerkcal Suppot 05S Ay Apskene Deslarer 6790 20-17 55 78 20o-17 ASSOUNUM ASSIGN DATE POJLM EPNN ASN KE ASSIGN CHO ASSN HOURS ASN CAR 2047 20N-17 22-1 18 108 845 35 216 7 4595 48.10 20o-17 22a-1 22 117 34.55 42 145 11 24-Mar-18 22-M-1 18 34 55 2 Be Technem 3455 20io17 845 1004 22-a-18 18 108 108 603 53 510 Cenard Suort 18.36 20ov-17 1006 22-M-18 25 601 06.75 22 212.86 1006 22--18 22 22M-18 25 22 M-1 18 104 501 06.75 42 406.36 113 100 50.75 33 03 132 86 78.06 1000 1000 23-M-18 15 115 501 06.75 55 5418 Table name: PROJECT FROJ_NLM PROJ_NAME Evergreen 21-18 15 117 509 54.55 24 1011 21-18 25 106 105 6.75 Se.75 4.3 FROJ_VALUE 1453500.00 PROJ_BALANCE EMP_NUM 1002350 00 103 2110346 00 108 23 M.1 18 21-1 25 23N1 22 23M1 15 328. 1012 1013 108 115 501 501 34 15 1635 18 Anber Wave 350OS00.00 1014 104 501 96.75 23 2709 Roing nde Starfigrt 22 SI345 20 102 1015 1010 105 503 002 845 106 6.1 47 515 45 25 eso500 o0 230seR0 00 107 21 Me-10 22 106 1017 21M10 10 21M-10 25 117 09 54.55 33 121 29 1010 1019 117 009 54.55 110.5 22 43 78.01 5e1.45 24Me-10 25 104 001 1120 24M-19 15 101 125 3.1 307 1021 24M-10 22 100 01 1105 1105 27 280.36 24.M-10 22 115 01 49 51.45 1029 24 M-10 22 105 125 35 4375 24M-10 1S 1124 1126 100 04.5 54.55 33 270.00 24 M-10 10 117 42 145.11
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

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