RelationalDBDesign
prev next prev next
  Course navigation
 
Lesson 7
Altering a table
 
Objective
Modify a table by adding or modifying columns.
   
One of the great virtues of a relational database is its flexibility. Once you create a table in your Oracle database, you can change certain aspects of the table with the ALTER TABLE SQL command.
What the ALTER TABLE can and cannot do
With the ALTER TABLE command, you can change many aspects of an existing table structure. You can:
  1. Rename the table
  2. Add a column to an existing table
  3. Change the attributes of a column, such as the size, data type, or default value of the column
  4. Modify the storage characteristics of the table
  5. Add or change integrity constraints on the table

You can also modify other attributes of a table, such as the partitioning or parallelism associated with the table.
The ALTER TABLE command, however, cannot drop a column from an existing table.
Syntax for ALTER TABLE command
There is a wide range of syntactical options for the ALTER TABLE SQL command, reflecting the many types of modifications you can enact with the command.
The basic syntax for the command is shown in the MouseOver below:

Alter Table Command
The next lesson shows how to delete a table from your Oracle database.
  Course navigation