Professional Documents
Culture Documents
SQL-6 Data Defintion Language
SQL-6 Data Defintion Language
(DDL)
Create Table
CREATE TABLE [schema.] table_name
[(relational_properties [,relational_properties, …])]
[physical_properties]
[table_properties];
relational_properties
[ column datatype [ DEFAULT expression ] [
column_ref_constraint ] [
[ column_constraint ] [… ] ] ]
physical_properties
[ [ PCTFREE value ]
[ PCTUSED value ]
[ INITRANS value ]
[ MAXTRANS value ] ]
[ TABLESPACE tablespace ]
table_properties
{ ENABLE / DISABLE }
[ VALIDATE ] [ NOVALIDATE ]
{ UNIQUE ( column [ , column , …] ) / PRIMARY KEY /
CONSTRAINT constraint }
Create Table
table_index_clause
[schema.] table_name [table_alias]
(column / column_expression [ASC] [DESC] , …… ) index_attributes
index_attributes
{[PCTFREE value]
[PCTUSED value]
[TABLESPACE tablespace / DEFAULT]
[NOSORT / REVERSE]
paralle_clause}
paralle_clause
NOPARALLEL / PARALLEL [integer]
Create Index
Index created.
The CREATE SEQUENCE
Statement
with_clause
WITH {READ ONLY} / {CHECK OPTION [CONSTRAINT constraint]}
Create View
add_column_options
[column datatype [DEFAULT expression] [column_ref_constraint ]
[[column_constraint] […]]]
modify_column_options
column [datatype] [DEFAULT expression] [column_constraint , …]
Alter Table
Table altered.
Transaction
Example:
SQL> COMMIT;
SQL> ROLLBACK;