11
Reply

Define Unique Key?

Ankur Jain

Ankur Jain

Aug 18, 2014
1.2k
0

    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.

    Shivam Shukla
    February 04, 2015
    1

    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.

    Piyush R.
    November 12, 2014
    1

    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.

    Ankur Jain
    August 18, 2014
    1

    Unique keys can be more than one

    Mukesh Kumar
    September 05, 2017
    0

    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.

    Piyush R.
    November 12, 2014
    0

    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...

    Yadagiri Reddy
    October 17, 2014
    0

    it allows unique values only

    Amol Ghanwat
    October 09, 2014
    0

    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.

    Sarath Kumar
    October 08, 2014
    0

    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.

    Munesh Sharma
    October 07, 2014
    0

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

    Munesh Sharma
    October 07, 2014
    0

    Unique key is a constraint which enforces uniqueness of values.

    Roymon TP
    October 06, 2014
    0