Adding a Column
The following example uses ALTER TABLE to add an INTEGER column:
CREATE TABLE myTable(
id INTEGER CONSTRAINT my_pk PRIMARY KEY,
status VARCHAR2(10),
last_modified DATE DEFAULT SYSDATE
);
SQL> ALTER TABLE myTable
2 ADD new_Column INTEGER;
Table altered.
SQL> desc myTable;
Name Null? Type
----------------------------------------- -------- -----------------
ID NOT NULL NUMBER(38)
STATUS VARCHAR2(10)
LAST_MODIFIED DATE
NEW_COLUMN NUMBER(38)
SQL>
The next example adds another column:
SQL> ALTER TABLE myTable
2 ADD when_to_start DATE DEFAULT SYSDATE NOT NULL;
Table altered.
SQL>
SQL>
SQL> DESCRIBE myTable
Name Null? Type
----------------------------------------- -------- ----------------
ID NOT NULL NUMBER(38)
STATUS VARCHAR2(10)
LAST_MODIFIED DATE
NEW_COLUMN NUMBER(38)
WHEN_TO_START NOT NULL DATE
SQL>