Indexes: Unique Indexes

Description: Using constraints is preferred to using triggers, rules, and defaults. A constraint enforces the integrity of a database. It defines rules regarding the values allowed in columns of a table. It is the standard mechanism for enforcing integrity.

CREATE UNIQUE INDEX <index_name>
ON <table_name> (<column_name>)
PCTFREE <integer>
TABLESPACE <tablespace_name>;
 
-- for w3mentor:
CREATE UNIQUE  INDEX uidx_sales_region_id
ON index_sales(city_id)
PCTFREE 0
TABLESPACE sales_us;

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.