Inserting, Updating, and Deleting Rows in Tables

All of the previous examples in this chapter show you how to retrieve data from tables in an Oracle database using various queries (SELECT commands). Now let's take a look at how to input, modify, and delete table data using the SQL commands INSERT, UPDATE, and DELETE.

EXERCISE 3.18: Inserting New Rows into a Table

To insert a new row into a table, you use the SQL command INSERT. For example, enter the following statement, which inserts a new part into the PARTS table:

INSERT INTO parts
 (id, description, unitprice, onhand, reorder)
 VALUES (6, 'Mouse', 49, 1200, 500);

This example statement demonstrates how to use the most common clauses and parameters of the INSERT command:

Use the INTO parameter ...

Get Hands-On Oracle Database 10g Express Edition for Windows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.