Can we use more than one null value for unique key?

Answer Posted / praveen hr

UNIQUE Constraints

You can use UNIQUE constraints to make sure that no
duplicate values are entered in specific columns that do
not participate in a primary key. Although both a UNIQUE
constraint and a PRIMARY KEY constraint enforce uniqueness,
use a UNIQUE constraint instead of a PRIMARY KEY constraint
when you want to enforce the uniqueness of a column, or
combination of columns, that is not the primary key.

Multiple UNIQUE constraints can be defined on a table,
whereas only one PRIMARY KEY constraint can be defined on a
table.

Also, unlike PRIMARY KEY constraints, UNIQUE constraints
allow for the value NULL. However, as with any value
participating in a UNIQUE constraint, only one null value
is allowed per column.

A UNIQUE constraint can be referenced by a FOREIGN KEY
constraint.

Link from MSDN http://msdn.microsoft.com/en-
us/library/ms191166.aspx

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an invalid partition table?

786


What is the primary use of normalization?

746


How do you rename a table in sql?

784


How to place comments in pl/sql?

860


What is primary and foreign key?

852


Show code of a cursor for loop.

824


How to return multiple rows from the stored procedure?

761


What are the different types of database management systems?

759


How do you clear the screen in sql?

815


What is the difference between python and sql?

754


Can a select statement fire a trigger?

932


What is prepared statement in sql?

793


How many developers work on postgresql?

768


How do I truncate a sql log file?

792


What does fetching a cursor do?

849