Defining primary key :
The is the combination of one or more field which uniquely identify particular tuple of a table.A table can have only one primary key.The primary key can be defined for a table before and after creation of table.
The creation of primary key constraint for a table during creation of table would be as follows :
Code:
CREATE TABLE table_name
(col1 datatype null/not null, col2 datatype null/not null,...
CONSTRAINT constraint_name PRIMARY KEY (col1, col2, . col_n));
In this way,you can define the primary key for a table during creation of table.
Bookmarks