Question: P 1 . Write the SQL code that will create only the table structure for a table named EMP _ 1 . This table P

P1. Write the SQL code that will create only the table structure for a table named EMP_1. This table P7. Using the EMP_2 table, write the SQL code that will add the attributes EMP_PCT and PROJ_NUM
to EMP_2. The EMP_PCT is the bonus percentage to be paid to each employec. The new attribute
characteristics are:
P8. Using the EMP_2 table, write the SQL code to change the EMP_PCT value to 3.85 for the person
whose employee number (EMP_NUM) is 103.
P9. Using the EMP_2 table, write a single SQL command to change the EMP_PCT value to 5.00 for the
people with employee numbers 101,105, and 107.
PIO. Using the EMP_2 table, write a single SQL command to change the EMP_PCT value to 10.00 for all
employees who do not currently have a value for EMP_PCT.
P11. Using the EMP_2 table, write the SQL command to add .15 to the EMP_PCT of the employee whose
name is Maria D. Alonzo. (Use the employce name in your command to determine the correct
employee.)
PI2. Using a single command sequence with the EMP_2 table, write the SQL code that will change the
project number (PROJ_NUM) to 18 for all employees whose job classification (JOB_CODE) is 500.
P13. Using a single command sequence with the EMP_2 table, write the SQL code that will change the
project number (PROJ_NUM) to 25 for all employees whose job classification (JOB_CODE) is 502 or
higher.
P14. Write the SQL code that will change the PROJ_NUM to 14 for employees who were hired before
January 1,1998, and whose job code is at least 501. When you finish Problems 6,7,8,9,10,11,
12,13, and 14, the EMP_2 table will contain the data shown in Figure 3.
Figure 3: The contents of the the EMP_2 Table
will be a subset of the ERPLOYEE table. The basic ERP_1 table structure is summarized in Table 1.
Use EMP_NUM as the primary key. Note that the JOB_CODE is the FK to JOB so be certain to enforce
referential integrity. Your code should also prevent null entries in EMP_LNAME and EMP_FNAME.
Table 1: The EMP_1 table structure
P2. Having created the table structure in problem Pl., write the SQL code to enter the first two rows
from the table shown in Figure 2. Each row should be inserted individually, without using a
subquery. Insert the rows in the order that they are listed in the figure.
Figure 2: The contents of the the EMP_1 Table
P3. Using the EMPLOYEE table that already exists, use a subquery to insert the remaining rows from
the EMPLOYEE table into the EMP_1 table. Remember, your subquery should only retrieve the
columns needed for the EMP_1 table and only the employees shown in Figure 2.
P4. Write the SQL code to change the job code to 501 for the person whose employee number
(EMP_NUM) is 107.
P5. Write the SQL code to delete the row for William Smithfield, who was hired on June 22,2008,
and whose job code is 500.(Hint: Use logical operators to include all of the information given in
this problem.
P6. Write the SQL code to create a copy of EMP_1, including all of its data, and naming the copy
EMP_2.
P 1 . Write the SQL code that will create only

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 Programming Questions!