Create Composite Index

Create Composite Index example

  
-- create Composite Index 
CREATE UNIQUE INDEX orders_unique_index 
  ON ORDERS (ORDER_ID, COURSE_ID, STUDENT_ID) ;

Output:

unique index ORDERS_UNIQUE_INDEX created.

Check indexes

select INDEX_NAME, INDEX_TYPE, UNIQUENESS
from USER_INDEXES
WHERE table_name='ORDERS';    

Output:

INDEX_NAME INDEX_TYPE UNIQUENESS
PK_ORDER_ID NORMAL UNIQUE
ORDERS_UNIQUE_INDEX NORMAL UNIQUE