Sqlserver Interview questions

Total available count: 45
Subject - Databases
Subsubject - Sqlserver

What is the difference between a primary key and a unique key?

Primary key:-

  • It creates clustered index on the column
  • It doesn't allow NULL values
  • It creates on one column

Unique key:-

  • It creates a non-clustered index on the column
  • It allows only one NULL value
  • It creates on multiple columns
  • A programmer can have many Unique key constraints per table, but only one Primary key constraint per table

Next 4 interview question(s)

What is NOT NULL Constraint?
What is Check Constraint?
What is Unique key constraint?
What is a Primary key?