As the name implies, an index-organized table is just another variety of a standard table. To create an index-organized table, a simple variation of the standard commands is used to create a table.
Create index-organized table Syntax
The syntax for creating an index-organized table is exactly like the syntax used to create a standard table, with a single added pair of keywords, as shown in the following Diagram:
As you can see from the ToolTip above , the only real difference between
defining a standard index and
defining an index-organized table
is the inclusion of the keywords ORGANIZATION INDEX at the end of the statement defining an index-organized table.
Oracle Data Definition Language (DDL) does support the keywords ORGANIZATION HEAP as an alternative, but because the HEAP structure is the default,
the only reason to include ORGANIZATION HEAP
in a DDL statement is for documentation.
An index-organized table must have a primary key, so you must also define a primary key constraint for the table.
Click the learning bridge if you would like to review primary keys.
How To Bridge Primary Keys
Example
The following code will create a table called sales figures as an index-organized table.