The following SQL statements include:
Create a table and specify the tablespace
Add Table remarks add field remarks
Add Constraints
Add Index
Assign and revoke permissions
-- Create Table
Create Table user name. Table Name
(
Field 1 number (19) not null,
Field 2 varchar2 (30) not null,
Field 3 integer not null
)
Tablespace name
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 64 K
Next 1 m
Minextents 1
Maxextents Unlimited
);
-- Add Table remarks
Comment on table user name. Table Name Is 'Remarks ';
-- Add field remarks add comments to the columns
Comment on column user name. Table name. Field name is 'Remarks content ';
-- (Constraint) Create/recreate primary, unique and foreign key constraints
Alter table user name. Table Name
Add constraint name primary key (field name) -- here is the primary key
Using Index
Tablespace name
Pctfree 10
Initrans 2
Maxtrans 255
Storage
(
Initial 64 K
Next 1 m
Minextents 1
Maxextents Unlimited
);
-- (INDEX) Create/recreate Indexes
Create index user name. Index name on user name. Table Name (field name)
Tablespace name
Pctfree 10
Initrans 2
Maxtrans 255
Storage
(
Initial 64 K
Next 1 m
Minextents 1
Maxextents Unlimited
);
-- (Assign and revoke permissions) grant/Revoke object privileges
Grant select, insert, update, delete on user name. Table name to utic_busiapp;