Home

Try YouTube in a new web browser!
Download Google Chrome

Us e the CREATE TABLE statement to create one of the following types of tables

A relational table , which is the basic structure to hold user data. An object table , which is a table that uses an object type for a column definition. An object table is explicitly defined to hold object instances of a particular type. You can also create an object type and then use it in a column when creating a relational table. Tables are created with no data unless a subquery is specified. You can add rows to a table with the INSERT statement. After creating a table, you can define additional columns, partitions, and integrity constraints with the ADD clause of the ALTER TABLE statement. You can change the definition of an existing column or partition with the MODIFY clause of the ALTER TABLE statement. Oracle Database Administrators Guide and CREATE TYPE for more information about creating objects. ALTER TABLE and DROP TABLE for information on modifying and dropping tables. To create a relational table in your own schema, you must have the CREATE TABLE system privilege. To create a table in another users schema, you must have the CREATE ANY TABLE system privilege. Also, the owner of the schema to contain the table must have either space quota on the tablespace to contain the table or the UNLIMITED TABLESPACE system privilege. In addition to these table privileges, to create an object table or a relational table with an object type column, the owner of the table must have the EXECUTE object privilege in order to access all types referenced by the table, or you must have the EXECUTE ANY TYPE system privilege. These privileges must be granted explicitly and not acquired through a role. Additionally, if the table owner intends to grant access to the table to other users, then the owner must have been granted the EXECUTE object privilege on the referenced types WITH GRANT OPTION , or have the EXECUTE ANY TYPE system privilege WITH ADMIN OPTION . Without these privileges, the table owner has insufficient privileges to grant access to the table to other users. To enable a unique or primary key constraint, you must have the privileges necessary to create an index on the table. You need these privileges because Oracle Database creates an index on the columns of the unique or primary key in the schema containing the table.