I've a table created with the below command. It has few rows now. If I want to insert a new field/column into the table then what is the command ? Thank you in advance.
CREATE TABLE emp ( emp_id NUMBER, ename VARCHAR2(40), hire_date DATE DEFAULT sysdate, rate NUMBER(5,2), CONSTRAINT emp_pk PRIMARY KEY (emp_id) );
Answer by KillerDBA ·
Generally, the "alter table add" DDL statement will do what you want.
If the link doesn't take you right to the reference, search the page for the string "Adding Table Columns"
The basic syntax is:
alter table <tablename> add (<column definitions>);
Note that you can add a NOT NULL column only if you also specify a default value.