Creating a Sample Table
CREATE TABLE admin_emp (
empno NUMBER(5) PRIMARY KEY,
ename VARCHAR2(15) NOT NULL,
job VARCHAR2(10),
mgr NUMBER(5),
hiredate DATE DEFAULT (sysdate),
photo BLOB,
sal NUMBER(7,2),
hrly_rate NUMBER(7,2) GENERATED ALWAYS AS (sal/2080),
comm NUMBER(7,2),
deptno NUMBER(3) NOT NULL,
comments VARCHAR2(4000),
status VARCHAR2(10))
STORAGE (INITIAL 50K)
Table created.
Adding A Column To A Table
ALTER TABLE admin_emp
ADD (bonus NUMBER (7,2))
Table altered.
Renaming A Column In A Table
ALTER TABLE admin_emp
RENAME COLUMN comm TO commission
Table altered.
Dropping Columns In A Table
ALTER TABLE admin_emp DROP (bonus, commission)
Table altered.
Marking Columns In A Table As Unused
ALTER TABLE admin_emp SET UNUSED (hiredate, mgr)
Table altered.
Dropping Unused Columns From A Table
ALTER TABLE admin_emp DROP UNUSED COLUMNS CHECKPOINT 250
Table altered.
Dropping A Table
DROP TABLE admin_emp
Table dropped.