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.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
![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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5e1132c9-beab-4f38-876e-7cf6bf6331b8%2Fa81a2bf3-5ad2-48bd-9a4b-7407de719715%2Ficfq9de_processed.jpeg&w=3840&q=75)
![1. Table : ASSIGNMENT
IASSIONVENT
ASON NM ASSIN SATEPROJ MM. EMP MM. ASSEN JO6 ASSIGN CHS ASSIGN HOURS ASSON CHAGE
2 14
22 Ma 14.22
2M14
22M 14
22M 142
21-14 22
22 M 1425
2Mar 14
2) Ma14
23Mer 14
1000
34.55
42
20
15 11
3456
100
100
1000
100
100
1000
6450
22
42
01
104
01
675
50.25
StartAPPCo database stores data for a consulting company that tracks all charges to projects. The
14
24
001
17
34.56
charges are based on the hours each employee works on each project. The ASSIGNMENT table stores
2Ma 14
21Mer 14
2Me 1425
2Me 142
501
the JOB_CHG_HOUR values as an attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the
data. The JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_HOUR change will
1013
115
501
190 0
21
61
501
875
103
545
23-Mar14 22
23Ma-14
2Ma-14 25
24Mar 14 25
24Me 1415
10600
13 20
be reflected in the ASSIGNMENT table. The structure and contents of the StartAPPCo database are
301
502
101
31
shown below.
10.50
AM 1422
15
110.50
5.0
se 45
24M1422
24Ma14
2M14
33
42
1511
EMPLOYEE
PK EMP NIM
gor
EMP LNAME
PK JOn_coDE
2. TABLE: EMPLOYEE
EMP FNAME
JOU DESCHTION
EMP INITIAL
a
EMROVEE
JOB OO HOUR
EMP RCDATE
EN E . E
h MPA ,
hew
Ser
A re
Raas A
Jt Ae
Smtteit Wm
100
lent
JOB LAST UPOATE
JOB CODE
100
104
106
106
10
19
14
at fa s
EMP_VLARS
Akre
Waing Ru
Geh
Oeko
W
Var
13
15
100
22Aup1s01
HE110
dead
A
11-Deca5 10
+111
16
ASSIGNMENT
Set Dat
12
113
etrod
Detert
R114
13
T ASSGNNUM
25 01
tavr
Pst
Wamee nge
Franne
Tee
15
10
10
2
110
Gesd
ASSIGN DATE
4.117
19.in36500
Jume
PROJECT
PROJ NUM
PK PROI NUM
EMP MUM
3. TABLE: JOB
PROI NAME
ASSGN KOR
PROI VALUE
ASSGN CHG HR
Popame
e Ara
Datere Despre
Caca ge
355
PROI ALANCK
ASGN HOURS
hon
12500
24M
20w
EMP NUM
ASSIGN CHANGE
eche agre
20 t
20w
20oy 13
20
24Mar.
430 20
20o-
Clence Suppet
26
Aooimoe Desgrer
Tachscan
C pat
510
18
4. TABLE: PROJECT
E PROECT
PRO RO NAE PROJ ALUE PR ALANC E NL
1000 e 10
21DS E I
Amber
Saig
230 e10](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5e1132c9-beab-4f38-876e-7cf6bf6331b8%2Fa81a2bf3-5ad2-48bd-9a4b-7407de719715%2Fzslqkgn_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)