SQL Lab 6
In this lab, you will cover several important topics:
SQL Update and Delete
SQL Commit and Rollback
SQL Aggregate Functions:
COUNT, SUM, MIN, MAX, AVG, ROUND, COALESCE
Update:
Run this SQL FIRST!
insert into departments (dept_no, dept_name)
values (‘d010′,’Business Analysis’);
Change the “Business Analysis” department name to “Data Analysis”.
Hint: To solve this exercise, use the “departments” table.
Delete:
Select all entries from the department table and notice department 10.
Issue a Commit.
Remove the department number 10 record from the “departments” table.
Select all entries from the department table and notice department 10. Is it missing?
Commit and Rollback:
Now, issue a Rollback command.
Select all entries from the department table and notice department 10. (should be back)
Remove the department number 10 record from the “departments” table.
Select all entries from the department table and notice department 10. Is it missing?
Issue a Commit command.
Select all entries from the department table and notice department 10. Is it missing?
Issue a Rollback command.
Select all entries from the department table and notice department 10. Is it missing? It should be!
**Please note that a Rollback will take your database back to the LAST Commit
Aggregate Functions: