You are on page 1of 19

Chapter 5

How to insert, update, and delete data


Objectives
• How to create test tables
• How to insert new rows
• How to update existing rows
• How to delete existing rows
How to create test tables
How to create a copy of a table
• You can use the CREATE TABLE AS statement
to create a new table based on the result set
defined by a SELECT statement.
How to create a copy of a table
(Cont.)
How to insert new rows
How to insert a single row and
multiple rows
How to insert a single row and
multiple rows -2
How to insert
default values and null values
How to insert
rows selected from another table
How to insert rows selected
from another table -2
How to update existing rows
How to update rows
How to update rows (2)
How to use subqueries in an
update operation
How to delete existing rows
How to delete rows
How to delete rows (2)
Summary

• INSERT
• UPDATE
• DELETE

You might also like