Example: Creating an Index

When you create an index using SQL Developer, you specify one or more table columns to be indexed and the type of index to create.

In this example, you create an index on the PROD_DESC column in the SH.PRODUCTS table. (The SH schema is part of the sample schemas.)

To create a description index on the SH.PRODUCTS table:

  1. In SQL Developer, view the tables in the SH schema, by following the instructions in "Viewing Tables".
  2. Right-click the PRODUCTS table, and select Index, and then Create Index.

    The Create Index dialog box appears, with the Definition tab displayed.

  3. At the top of the dialog box, confirm that SH appears in the Schema field and that PROD_DESC_IDX appears in the Name field.
  4. On the Definition tab:
    • In the Table Schema field, enter SH.

    • In the Table field, select PRODUCTS.

    • In the Index Type field, select Non-Unique.

    • Click the green check mark item in the Expressions section, and in the row that displays, enter PROD_DESC in the Expressions column, and <Not Specified> in the Order column.

      If your index were to consist of multiple columns (a concatenated index), then you would add a second column in the Expressions section to add it to the list of columns in the Index list. Then you would use the up arrow and down arrow icons to arrange the index columns in the order you want.

      If the index includes multiple columns, choose either ASC (ascending) or DESC (descending) in the Order field. The value you choose determines the sort order to be used for the index.

  5. Click OK to create the index.

See Also:

"About Indexes"