Ankur Jain
Define Unique Key?
By Ankur Jain in SQL Server on Aug 18 2014
  • Shivam Shukla
    Feb, 2015 4

    The UNIQUE constraint uniquely identifies each record in a database table. The UNIQUE and PRIMARY KEY constraints both provide a guarantee for uniqueness for a column or set of columns. A PRIMARY KEY constraint automatically has a UNIQUE constraint defined on it. Note that you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per table.

    • 1
  • Piyush R.
    Nov, 2014 12

    UNIQUE key also work same as primary key and allows only unique value in table, but the other feature is that it allows ONLY ONE NULL VALUE also (because NULL also a value for database) whereas primary key does not allows any NULL value in table.

    • 1
  • Ankur Jain
    Aug, 2014 18

    Unique key is a one or more column that must be unique for each row of the table. It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

    • 1
  • Mukesh Kumar
    Sep, 2017 5

    Unique keys can be more than one

    • 0
  • Piyush R.
    Nov, 2014 12

    UNIQUE key also work same as primary key and allows only unique value in table, but the other feature is that it allows ONLY ONE NULL VALUE also (because NULL also a value for database) whereas primary key does not allows any NULL value in table.

    • 0
  • Yadagiri Reddy
    Oct, 2014 17

    unique key eliminates the duplication of values and does allow the values uniquely. but unique key allows the NULL values. if u take primary key it won't allow duplications and it won't allow NULL values also.. one more important thing is, if you want to import the foreign key on any column that column must imposed with primary key. here you can't use the unique key...

    • 0
  • Amol Ghanwat
    Oct, 2014 9

    it allows unique values only

    • 0
  • Sarath Kumar
    Oct, 2014 8

    To ensure no duplicate values are entered in specific columns that do not participate in a primary key. Creating a unique constraint automatically creates a corresponding unique index.

    • 0
  • Munesh Sharma
    Oct, 2014 7

    Primary key is only one in a table but unique key can be more then one. primary key does not have null value but unique can have one null value. primary key is by default clustered index but unique is by default non-clustered index. primary key has reference key in another table and unique key also has reference key in another table.

    • 0
  • Munesh Sharma
    Oct, 2014 7

    http://dotnet-munesh.blogspot.in/2013/12/difference.html

    • 0
  • Roymon TP
    Oct, 2014 6

    Unique key is a constraint which enforces uniqueness of values.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS