Drop Unique Constraint and Add Primary Key
SQL>
SQL> CREATE TABLE myTable (
2 Name VARCHAR(50) NOT NULL,
3 PhoneNo VARCHAR(15),
4 CONSTRAINT unq_name UNIQUE(Name));
Table created.
SQL>
SQL> ALTER TABLE myTable DROP CONSTRAINT unq_name;
Table altered.
SQL> ALTER TABLE myTable ADD CONSTRAINT PK_myTableName PRIMARY KEY (Name);
Table altered.
SQL>
SQL>
SQL> drop table myTable;
Table dropped.
Related examples in the same category