Please answer 11 and 12 in detail. Write the SQL code to change the EMP_PCT valu
ID: 3808255 • Letter: P
Question
Please answer 11 and 12 in detail. Write the SQL code to change the EMP_PCT value to 3.85 for the person whose employee number (EMP_NUM) is 103. Next, write the SQL command sequences to change the EMP_PCT values, as shown in Figure P79. Using a single command sequence, write the SQL code that will change the project number (PROUNUM) to 18 for all employees whose job classification (JOB CODE) is 500. Using a single command sequence, write the SQL code that will change the project number (PROLNUM) to 25 for all employees whose job classification (JOB CODE) is 502 or higher. When you finish Problems 10 and 11, the EMP_2 table will contain the data shown in Figure P7.11. (You may assume that the table has been saved again at this point) Write the SQL code that will change the PROJ_NUM to 14 for employees who were hired before January 1, 1994, and whose job code is at least 501. (You may assume that the table will be restored to its condition preceding this question) Write the two SQL command sequences required to: a. Create a temporary table named TEMP_1 whose structure is composed of the EMP_2 attributes EMP_NUM and EMP_PCT b. Copy the matching EMP_2 values into the TEMP_1 table. Write the SQL command that will delete the newly created TEMP_1 table from the database.Explanation / Answer
11.
UPDATE EMP_2
SET PROJ_NUM=25
WHERE JOB_CODE>=502;
12.
UPDATE EMP_2
SET PROJ_NUM=14
WHERE JOB_CODE>=501 AND EMP_HIREDATE < '1991-01-01';
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.