Can you please differentiate between a primary key and a unique key?



Can you please differentiate between a primary key and a unique key?..

Answer / Akhil Kumar

{"Primary Key (PK) and Unique Key (UK) are used to enforce data integrity in SQL Server, but there is one main difference:
1. Primary Key: Must contain a column or columns that uniquely identify each row.
2. Unique Key: Can have NULL values in one or more columns, as long as the combination of all columns is unique.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Explain Trigger with an example?

2 Answers  


can any one please send sql quries most used in applications.

2 Answers  


What is user stored procedure & it purpose?

4 Answers   Wipro,


List out the difference between union and union all in sql server?

1 Answers  


Is it possible to call a stored procedure within a stored procedure?

1 Answers  


What is difference between drop truncate and delete?

1 Answers  


Which sql server table is used to hold the stored procedure script?

1 Answers  


How to create function with parameter in sql server?

1 Answers  


How to retrieve duplicate rows in a table? How to delete the duplicate entries in a table?

15 Answers   Leo Technologies, Mannar Company, Synechron,


Why use “pivot” in sql server?

1 Answers  


Explain the different types of joins?

1 Answers  


How would you use user_constraints table in DB?

1 Answers   Wipro,


Categories