DROP Table Statement in Oracle
DROP statement is used to do below operations:
- DROP ONE OR MORE EXISTING COLUMNS
- DROP AN EXISTING TABLE
DROP ONE OR MORE EXISTING COLUMNS:
We have an existing table called EMP_ALTER_TAB with below definition:
DROP SINGLE COLUMN:
ALTER TABLE EMP_ALTER_TAB DROP(JOB_ID);
DESC EMP_ALTER_TAB;
ALTER TABLE EMP_ALTER_TAB DROP COLUMN LAST_NAME;
DESC EMP_ALTER_TAB;
DROP MULTIPLE COLUMNS:
ALTER TABLE EMP_ALTER_TAB DROP(HIREDATE, SALARY, DEPARTMENT_ID);
DESC EMP_ALTER_TAB;
DROP AN EXISTING TABLE:
DROP TABLE EMP_ALTER_TAB;
SELECT TABLE_NAME, TABLESPACE_NAME, STATUS, NUM_ROWS, TABLE_LOCK FROM USER_TABLES WHERE TABLE_NAME = 'EMP_ALTER_TAB';
RELATED TOPICS: