Answered step by step
Verified Expert Solution
Question
1 Approved Answer
These pictures are as clear as can be. Please answer correctly! The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to
These pictures are as clear as can be.
Please answer correctly!
The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure of the database are shown in Figure P8.1
Note that the ASSIGNMENT table in Figure P8.1 stores 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 be reflected in the ASSIGNMENT table. Naturally, the employee primary job assignment might also change, so the ASSIGN_JOB is also stored. Because those attributes are required to maintain the historical accuracy of the data, they are NOT redundant.
Given the structure and contents of the Ch08_ConstructCo database shown in Figure P8.1, use SQL commands to answer the following problems.
2. Having created the table structure shown in TABLE 8.1, write the SQL code to enter the first two rows for the table shown in Figure P8.2. Each row should be inserted individually, without using a subquery. Insert the rows in the order that they are listed in the figure.
4. Write the SQL code that will save the changes made to the EMP_1 table (if supported by your DBMS - assuming in Oracle DBMS).
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.)
8. (EMP_2 table is a copy of EMP_1, please refers to Problem 7) Using 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 employee. The new attribute characteristics are:
EMP_PCT NUMBER (4, 2)
PROJ_NUM CHAR(3)
10. 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.
12. Using the EMP_2 table, write the SQL command to add 0.15 to the EMP_PCT of the employee whose name is Maria D. Alonzo. (Use the employee name in your command to determine the correct employee.)
14. 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 500.
Thanks in advance!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started