In the primary key have a multiple field or not?

Answer Posted / prashanth kumar

Yes , it have multiple fields.Run below query and creating
primary key on p_Id and LastName.

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

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio

687


What are the properties of the transactions?

706


What is the difference between stored procedure and user defined functions?

720


Why truncate is ddl?

705


Explain different types of index?

686






What is a partition key?

593


Difference between Inner vs outer joins?

607


What is forward - only cursors / read only cursor?

626


What is the purpose of the master database?

708


What is ms sql server triggers?

626


Is sql server is free?

627


where the connection string store in the database

1626


Explain alternate key, candidate key and composite key in sql server?

582


Why do we partition data?

698


Some queries related to SQL

661