what's the difference between a primary key and a unique key? : Sql server database administration



what's the difference between a primary key and a unique key? : Sql server database administrat..

Answer / Manoj Kumar Tiwari

A Primary Key is a column or group of columns in a table that uniquely identifies each row. It must contain unique, non-null values and cannot be changed once set. A Unique Key is similar to a Primary Key but can be composed of multiple columns and allows for null values (if all columns allow nulls). However, if the table has a Primary Key, it cannot have more than one Unique Key.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Why use “pivot” in sql server?

1 Answers  


How to handle error or exception in sql?

1 Answers  


What is the default Port No on which SQL Server listens?

1 Answers  


to explain sql server 2000 architecture & authentication

1 Answers   HCL,


How many tables can be joined in SQL Server?

1 Answers   Cap Gemini,


Accidentally i deleted my table. How can i get that table?

4 Answers  


Does group by sort data?

1 Answers  


In clustered and non clustered indexes which one is faster while executing a query ?

1 Answers  


There is a table1 with records (1,2,3,4,5,6) and table2 with records (4,5,6,7,8,9).write a query so as to get the result as 1,2,3,4,5,6,7,8,9

12 Answers   RBS,


Explain the disadvantages/limitation of the cursor?

1 Answers  


1. What are the grouping function in SQL ? 2. If base table of a view deleted means, what will happen while we querying on view ? will give any error ? 3. Difference between DROP, DELETE, TRUNCATE table ? 4. What is constraints and types ? 5. What is max size of nchar & nvarchar ? 6. Define ROLLBACK, COMMIT, SAVE POINT 7. How non-clustered better ? or rank the Clustered, Non-Clustered and Table scan in performance wise 8. Select 10 rows from a table ? 9. Define DML, DDL, DCL, DTL commands ? 10. What is mean by NULL value ? NULL means "" or 0 or undefined ? 11. Default constraints ? 12. Can we have more then primary Key in table ? 13. Type of integrity ? Entity, Referential, Domain ?

10 Answers   Perot Systems,


What is entity data services?

1 Answers  


Categories