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
How to check if a column is nullable before setting to nullable?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
How do you truncate?
What is full join in sql?
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
What is the maximum number of rows in sql table?
What is nosql vs sql?
what is myisam? : Sql dba
What is a data manipulation language?
what is the difference between cluster and non cluster index? : Sql dba
What is a primary key sql?
How to sort the rows in sql.
What is rownum?
What is sql mysql pl sql oracle?
Why use triggers in sql?