PRIMARY KEY
Primary key is
cloumn in a table that uniquely identify the earch rows.
A table has only one primary key and primary can not be hold the null value.
(
Id INT
NOT NULL,
Name varchar(255) NOT NULL,
Address varchar(255),
Age INT,
CONSTRAINT
pk_EmployeeID PRIMARY KEY
(Id)
)
Following is the example to apply PRIMARY KEY Constraint on ALTER TABLE
ALTER TABLE Employee
ADD PRIMARY KEY (Id)
Following is the example to DROP a PRIMARY KEY Constraint
ALTER TABLE Employee
No comments:
Post a Comment