You have now completed a whirlwind tour of how to create tables and constraints.
In this module, you practiced creating a table with several columns and saw how to set the space parameters for a table
and watched what happens when a table outgrows its initial allocation of space. You observed what happens when you drop a table. You also saw how to disable a constraint and when you need to do that.
In this module, you learned how to:
- Identify the components of the
CREATE TABLE command
- Describe how tables, tablespaces, and datafiles fit together
- Identify the parameters that define storage space
- Describe the advantages of using
PRIMARY KEY constraints
- Identify the syntax components of the
- Change columns in an existing table
- Describe the effects of dropping a table and disabling or removing a constraint
In Oracle, you can use the CREATE TABLE statement to set the space parameters for a table. You can specify the storage clause with the following options:
- INITIAL: Specifies the initial amount of space allocated for the table.
- NEXT: Specifies the amount of space allocated for each extent.
- MINEXTENTS: Specifies the minimum number of extents allocated for the table.
- MAXEXTENTS: Specifies the maximum number of extents allocated for the table.
- PCTINCREASE: Specifies the percentage increase in space allocated for each extent.
- FREELISTS: Specifies the number of free lists for the table.
- FREELIST GROUPS: Specifies the number of free list groups for the table.
Here is an example of how to create a table with space parameters:
CREATE TABLE mytable (
FREELIST GROUPS 1
Please keep in mind that some of the above options may be deprecated and you should check the Oracle documentation for the most recent information.