Queyquep MIDTERM PRACTICESET8
Queyquep MIDTERM PRACTICESET8
Queyquep MIDTERM PRACTICESET8
Instructions:
● Study the lecture files provided from FILES > Finals > Finals Lecture 3
● Perform the examples provided and solve the hands-on problems in Practice Set 8
(Practice08 pdf file)
● Use your newly created virtual machine
● Connect to the SQL Plus using your assigned ORA user. Example
ora1/ora1@pdbINITIALS (Ex. pdbpjmc). Make sure you were able to run the setup.sql
script in this pdbINITIALS.
● Answer all the questions provided
● Analyze and perform the problems below and answer it to the best of your ability
● Write your complete answer in a Short Bond Paper and provide softcopy documentation.
● Include screen shots of your complete SQL Statements and the result/s (for hands-on
problems)
● Include a brief description/caption of each image
● There must be a name for each image (see example below)
● Save your work as DOC pr PDF (Ex. CASTRO_MIDTERM_PRACTICESET8.DOC)
1. Run the statement in the lab8_1.sql script to build the MY_EMPLOYEE table that will be used
for the lab.
DESC my_employee
3. Add the first row of data to the MY_EMPLOYEE table from the following sample data. Do not
list the columns in the INSERT clause.
4. Populate the MY_EMPLOYEE table with the second row of sample data from the preceding
list.
This time, list the columns explicitly in the INSERT clause.
SELECT *
FROM my_employee;
ID LAST_NAME FIRST_NAME USERID SALARY
1 Patel Ralph rpatel 895
2 Dancs Betty bdancs 860
3 Biri Ben bbiri 1100
4 Newman Chad cnewman 750
5 Ropeburn Audrey aropebur 1550
6. Write an insert statement in a text file named loademp.sql to load rows into the
MY_EMPLOYEE table. Concatenate the first letter of the first name and the first seven
characters
of the last name to produce the userid.
7. Populate the table with the next two rows of sample data by running the insert statement in
the
script that you created.
SELECT *
FROM my_employee;
COMMIT;
11. Change the salary to 1000 for all employees with a salary less than 900.
UPDATE my_employee
SET salary = 1000
WHERE salary < 900;
DELETE
FROM my_employee
WHERE last_name = ’Dancs’;
SELECT *
FROM my_employee;
COMMIT;
Control data transaction to the MY_EMPLOYEE table.
16. Populate the table with the last row of sample data by modifying the statements in the script
that
you created in step 6. Run the statements in the script.
SELECT *
FROM my_employee;
18. Mark an intermediate point in the processing of the transaction.
SAVEPOINT step_18;
DELETE
FROM my_employee;
SELECT *
FROM my_employee;
21. Discard the most recent DELETE operation without discarding the earlier INSERT operation.
ROLLBACK TO step_18;
COMMIT;