Setting a Unique Constraint
SQL>
SQL>
SQL> CREATE TABLE myTable (
2 Name VARCHAR(50) NOT NULL,
3 PhoneNo VARCHAR(15) DEFAULT 'Unknown Phone' NOT NULL,
4 CONSTRAINT MyUniqueKey UNIQUE (Name)
5 );
Table created.
SQL>
SQL> drop table myTable;
Table dropped.
SQL>
SQL>
Related examples in the same category