questions. Write the SQL code to enter the rows shown in the following Figure inside the table EMP_1. EMP NTIAL EMP NUM EMP LNAME EMP FNAME EMP HIREDATE JOB_CODE 08-Nov-00 502 12-Jul-89 501 101 News John 102 103 Senior David Arbough June 01-Dec-96 500 104 Ramoras Anne 15-Nov-87 501 105 106 107 Johnson Alice 01-Feb-93 502 Smithfield William 22-Jun-04 500 10-Oct-93 500 Alonzo Maria 108 Washington Ralph Larry B 22-Aug-91 501 109 Smith 18-Jul-97 501 OHEKK

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter8: Sql Functions And Procedures
Section: Chapter Questions
Problem 10TD
icon
Related questions
Question
a SELECT DISTINCT on the results set.
IIL
Activities
1) In this activity, refer to the Construct Company schema studied in activity one of lab 3.
a) Load the ConstructCompany Schema.sql script and execute it to create all the tables of the
schema. Use this database to answer the following questions.
b) Write the SQL code to enter the rows shown in the following Figure inside the table EMP 1.
EMP_NUM EMP LNAME
News
Senior
Arbough
Ramoras
Johnson
Smithfield
101
102
EMP FNAME EMPNTIAL EMP HIREDATE JOB CODE
John
David
G
08-Nov-00 502
H
12-Jul-89 501
103
104
105
June
01-Dec-96 500
Anne
K
15-Nov-87 501
01-Feb-93 502
22-Jun-04 500
Alice
K
106
107
108
109
William
Alonzo
Maria
D
10-Oct-93 500
Washington Ralph
22-Aug-91 501
Smith
Lerry
18-Jul-97 501
c) Write the SQL code that will list all attributes for a job code of 502.
d) Write the SQL code that will save the changes made to the EMP_1 table.
e) Write the SQL code to change the job code to 501 for the person whose employee number
(EMP_NUM) is 107. After you have completed the task, examine the results, and then reset
the job code to its original value.
f) Write the SQL code to delete the row for the person
on June 22, 2004, and whose job code classification is 500
William Smithfield, who was hired
g) Write the SQL code required to list all employees whose last names start with Smith.
ndows bulw
alacl Jhil
h) Using the EMPLOYEE, JOB, and PROJECT tables in ConstructCompany Schema, write the
SQL code that will produce the result shown in the following Figure.
(Soi iall
TOSHIBA
F6
F7
F8
BVD
F10
F11
F12
INS
SCROLL LOCK
6.
&
7.
V.
8.
- BA
T.
P.
1.
HiJ
1.
%3D
Transcribed Image Text:a SELECT DISTINCT on the results set. IIL Activities 1) In this activity, refer to the Construct Company schema studied in activity one of lab 3. a) Load the ConstructCompany Schema.sql script and execute it to create all the tables of the schema. Use this database to answer the following questions. b) Write the SQL code to enter the rows shown in the following Figure inside the table EMP 1. EMP_NUM EMP LNAME News Senior Arbough Ramoras Johnson Smithfield 101 102 EMP FNAME EMPNTIAL EMP HIREDATE JOB CODE John David G 08-Nov-00 502 H 12-Jul-89 501 103 104 105 June 01-Dec-96 500 Anne K 15-Nov-87 501 01-Feb-93 502 22-Jun-04 500 Alice K 106 107 108 109 William Alonzo Maria D 10-Oct-93 500 Washington Ralph 22-Aug-91 501 Smith Lerry 18-Jul-97 501 c) Write the SQL code that will list all attributes for a job code of 502. d) Write the SQL code that will save the changes made to the EMP_1 table. e) Write the SQL code to change the job code to 501 for the person whose employee number (EMP_NUM) is 107. After you have completed the task, examine the results, and then reset the job code to its original value. f) Write the SQL code to delete the row for the person on June 22, 2004, and whose job code classification is 500 William Smithfield, who was hired g) Write the SQL code required to list all employees whose last names start with Smith. ndows bulw alacl Jhil h) Using the EMPLOYEE, JOB, and PROJECT tables in ConstructCompany Schema, write the SQL code that will produce the result shown in the following Figure. (Soi iall TOSHIBA F6 F7 F8 BVD F10 F11 F12 INS SCROLL LOCK 6. & 7. V. 8. - BA T. P. 1. HiJ 1. %3D
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Table
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.
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning