Examples

The following example adds a new column to scott’s table emp:

ALTER TABLE scott.emp
   ADD (bonus NUMBER(7,2)

The following example increases the size of the bonus column to 9 digits:

ALTER TABLE scott.emp
   MODIFY (bonus NUMBER(9,2)

The following example adds a primary key constraint to scott’s emp table:

ALTER TABLE scott.emp
   MODIFY (empno CONSTRAINT pk_emp PRIMARY_KEY)

Get Oracle Database Administration: The Essential Refe 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.