Database 4

profileskynge
module_4_database.docx

Chapter 7

Only Question 1, and 7 need to be completed for chapter 7. The only reason I added 5 and 6 is because question 7 says to write the SQL code that will restore the data to its original status; that is, the table should contain the data that existed before you made the changes in Problems 5 and 6

1. Write the SQL code that will create the table structure for a table named EMP_1. This table is a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in the following table. (Note that the JOB_CODE is the FK to JOB.)

5. 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.

6 Write the SQL code to delete the row for William Smithfield, who was hired on June 22, 2004, and whose job code is 500. (Hint: Use logical operators to include all of the information given in this problem.)

7 Write the SQL code that will restore the data to its original status; that is, the table should contain the data that existed before you made the changes in Problems 5 and 6.

Chapter 8

1. Create the tables. (Use the MS Access example shown in Figure P8.1 to see what table names and attributes to use.) See table below

6. Write the query that will generate only the records that are unique to the CUSTOMER_2 table.

Figure P8.5Duplicate Customer Records

Duplicate Customer Records

Figure P8.6Customers Unique to the CUSTOMER_2 Table

Customers Unique to the CUSTOMER_2 Table