Have a Question?

If you have any question you can ask below or enter what you are looking for!



SQL Primary key Syntax

What is the syntax of creating Primary key on Empno column in existing Employee table?

  Devbrat Tripathi

Hi,

for creating new table syntax will be below .

CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
City varchar(255),
PRIMARY KEY (P_Id)
)

if we have already Employee table then syntax will be below.

alter employee table add primary key (columns names ).






  Rakesh Sharma       18 Aug 2016       0       0     

Post Your Answers:

Please use the CODE HIGHLIGHT Button to format/highlight your codes if any