Add more columns : Add Column « Table « Oracle PL/SQL Tutorial






SQL>
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 ADD (EMail VARCHAR(25), ICQ VARCHAR(15));

Table altered.

SQL>
SQL> drop table myTable;

Table dropped.

SQL>








6.21.Add Column
6.21.1.Add columns
6.21.2.Add a column with NOT NULL constraint
6.21.3.Add more columns
6.21.4.Add new column with default value and not null