Alter a table to insert primary key and index
SQL>
SQL> create table inventory(
2 partno number(4),
3 partdesc varchar2(35),
4 price number(8,2),
5 warehouse varchar2(15));
Table created.
SQL>
SQL> Create index invent_part_loc_idx
2 On inventory (partno, warehouse);
Index created.
SQL>
SQL>
SQL> Alter table inventory add (
2 Constraint invent_partno_pk primary key (partno)
3 Using index invent_part_loc_idx);
Table altered.
SQL>
SQL>
SQL>
SQL> drop table inventory;
Table dropped.
SQL>
Related examples in the same category