Oracle PL/SQL:CREATE TABLE statement: create a table with primary key.CREATE TABLE statement can be used to create table objects in database. It is possible to add constraints like primary key ,foreign key while table creation.Primary key is the unique identifier for a row of data.One ...
In the above CREATE TABLE syntax,table_nameis the name of the table you want to give,column_name1is the name of the first column,column_name2would be the name of the second column, and so on. Thedata_typeis the type of data a column is going to be stored e.g string, integer, ...
Let see how to code a CREATE TABLE statement below,CREATE TABLE TB_TAB1 (TAB1_COL1 INTEGER NOT NULL PRIMARY KEY, TAB1_COL2 INTEGER NOT NULL, TAB1_COL3 VARCHAR(5) REFERENCES ZIPCODE(ZIP) ON DELETE CASCADE, TAB1_COL4 DATE WITH DEFAULT, TAB1_COL5 CHAR(20) NOT NULL UNIQUE, TAB1_...
create_table_statement ::=CREATETABLE[ IFNOTEXISTS] table_identifier'('column_definition (','column_definition )*','PRIMARYKEY'('primary_key')'(','{KEY|INDEX} [index_identifier] [USINGindex_method_definition ] [ INCLUDE column_identifier (','column_identifier )*] [WITHindex_options ] )*...
SQL CREATE TABLE Statement Example The following example creates a table namedproductwith columns namedproduct_nbr,product_name,product_status_code,start_date,end_dateandraw_material_cost_amt. This SQL CREATE TABLE Statement is executed: CREATE TABLE product ( product_nbr int NOT NULL, ...
通过CREATE TABLE [IF NOT EXISTS] <table_name> [LIFECYCLE <days>] AS <select_statement>;语句可以再创建一个表,并在建表的同时将数据复制到新表中。 但通过该语句创建的表不会复制分区属性,只会把源表的分区列作为目标表的一般列处理,也不会复制源表的生命周期属性。 您还可以通过lifecycle参数回收表。同...
Indicate that a clustered or a nonclustered index is created for the PRIMARY KEY or UNIQUE constraint. PRIMARY KEY constraints default to CLUSTERED, and UNIQUE constraints default to NONCLUSTERED. In a CREATE TABLE statement, CLUSTERED can be specified for only one constraint. If CLUSTERED is spec...
PL/SQL Tutorial SQL CREATE TABLE StatementThe CREATE TABLE Statement is used to create tables to store data. Integrity Constraints like primary key, unique key, foreign key can be defined for the columns while creating the table. The integrity constraints can be defined at column level or table...
<create_table_statement> ::= CREATE TABLE <table_name> (<table_description_element> [,<table_description_element>,...]) [IGNORE ROLLBACK] [<sample_definition>] [CACHE] [NOCACHE] | CREATE TABLE <table_name> [(<table_description_element>,...)] [IGNORE ROLLBACK] [<sample_definition>]...
CREATE TABLE statementThe CREATE TABLE statement defines a table. The definition must include its name and the names and attributes of its columns. The definition can include other attributes of the table, such as its primary key and its table space. Invocation for CREATE TABLE This statement ...