Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




Of Interest

Be responsible for your future
Enter the USA legally!

Visa, Green Card, Citizenship, Passport
Consultation Services








Oracle » DDL » Design »

Creating indexes

     





CREATE UNIQUE INDEX EMP_IDX ON EMPLOYEE (EMP_ID) ;


/* index create - table has sorted data */

CREATE UNIQUE INDEX IDX_INVOICE_ITEMS ON INVOICE_ITEMS
(INVOICE_ID,YEAR,FREQ_CODE,FREQ_NUMBER,FIELD_NUMBER,RECORD_SEQ)
TABLESPACE TS_07
NOLOGGING
NOSORT ;


/* create index - constraint */

ALTER TABLE INVOICE_FORMAT
ADD CONSTRAINT PK_INVOICE_FORMAT PRIMARY KEY(INVOICE_ID)
USING INDEX TABLESPACE PROD_IDX_01;



/* Get index information */

select
a.column_name, a.column_position,a.index_name, b.uniqueness
from user_ind_columns a, user_indexes b
where a.index_name=b.index_name and
a.table_name ='IDX_INVOICE_ITEMS'
order by a.index_name, a.column_position;





/* create bitmap index - table is fairly static,
and has less than 1000 distinct values in the indexed column */

CREATE BITMAP INDEX BIX_INVOICE_ARCHIVE
ON INVOICE_ARCHIVE (SALES_ID)
TABLESPACE PROD_IDX_01;













Oracle : Related Topics

Oracle : DDL : Creating a table
Oracle : DDL : Creating constraints
Oracle : DDL : Creating and using a sequence
Oracle : DDL : Synonyms and Database Links
Oracle : DDL : Changing a column's type or name
Oracle : DDL : Partitioned Tables
Oracle : DDL : Alter a column
Oracle : DDL : Creating an index with the nosort option
Oracle : DDL : Oracle data types

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site



Get the latest Rocket99 news and tech tips via






Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2019 Stoltenbar Inc All Rights Reserved.