The Primary key of a relational table should uniquely identify each record in the table. These Keys contains only Unique Values and cannot be Null. It Ensures only Unique Values by which we can easily get a record in table.
Each Table can have only one primary key but can have many unique keys. (Candidate Columns)
Syntax for Creating Primary key is,
CREATE TABLE EMP ( E_Id int NOT NULL PRIMARY KEY, L_Name varchar(255) NOT NULL, F_Name varchar(255), )
To Insert Primary key in a table,
ALTER TABLE EMP ADD CONSTRAINT pk_ID PRIMARY KEY (E_Id,L_Name)
To Drop a Primary Key in a table,
ALTER TABLE EMP DROP CONSTRAINT pk_ID