Drop a column : Drop Columns « Table « Oracle PL / SQL






Drop a column

   
SQL>
SQL> CREATE TABLE myTable (
  2     Name    VARCHAR(50) PRIMARY KEY NOT NULL,
  3     PhoneNo VARCHAR(15) DEFAULT 'Unknown Phone',
  4     SSN     VARCHAR(15) NOT NULL,
  5     CHECK (SSN LIKE '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'));

Table created.

SQL>
SQL>
SQL>
SQL> ALTER TABLE myTable DROP COLUMN PhoneNo;

Table altered.

SQL>
SQL> drop table myTable;

Table dropped.

SQL>

   
    
    
  








Related examples in the same category

1.Alter table to Drop a column
2.Dropping Columns and query user_unused_col_tabs