Basic Oracle Concepts and Programming Question:
Download Job Interview Questions and Answers PDF
How To Create a Table Index in Oracle?
Answer:
If you have a table with a lots of rows, and you know that one of the columns will be used often a search criteria, you can add an index for that column to in improve the search performance. To add an index, you can use the CREATE INDEX statement as shown in the following script:
CREATE TABLE tip (id NUMBER(5) PRIMARY KEY,
subject VARCHAR(80) NOT NULL,
description VARCHAR(256) NOT NULL,
create_date DATE DEFAULT (sysdate));
Table created.
CREATE INDEX tip_subject ON tip(subject);
Index created.
CREATE TABLE tip (id NUMBER(5) PRIMARY KEY,
subject VARCHAR(80) NOT NULL,
description VARCHAR(256) NOT NULL,
create_date DATE DEFAULT (sysdate));
Table created.
CREATE INDEX tip_subject ON tip(subject);
Index created.
Download Oracle Database Interview Questions And Answers
PDF
Previous Question | Next Question |
How To Drop an Existing Table in Oracle? | How To Rename an Index in Oracle? |