Oracle SQL - ALTER TABLE and RENAME Commands


You can use ALTER TABLE command to change table structure and constraints.

You can add columns or constraint definitions to an existing table with the ADD option.

The MODIFY option allows you to change definitions of existing columns.

For example, you can widen a column, allow null values with NULL, or prohibit null values with NOT NULL.

You can drop columns from tables with the DROP COLUMN option.

This will remove the column physically from the table structure.

The following code uses ALTER TABLE Command to add a new column.

SQL> alter table registrations
  2  add  (entered_by number(4) default 7009 not null);

To drop a column

SQL> alter table registrations
  2  drop  column entered_by;