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_NAMEINDEX_TYPEUNIQUENESS
PK_ORDER_IDNORMALUNIQUE
ORDERS_UNIQUE_INDEXNORMALUNIQUE