Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / dqm

In theory, a unique key may not contain any nulls. The
reason is simple: the key, by definition is an identifier
and it is illogical to identify something by an unknown.

In practice, some SQL databases permit nulls in unique
keys. Oracle, in particular, allows nulls as long as no
duplicate indices are created in the underlying unique
index. Since Oracle does not create a indices if all
columns are null, the floodgates are open.

For example, for a single column key, this is acceptable
because only the first row makes it to the index:

1
null
null


For a two column key, this is acceptable because in the
first two rows, the first column is unique and the last two
rows, being entirely null, are not represented in the index.

1, null
2, null
null, null
null, null

However, with the same two-column index, this is
unacceptable because the first two rows produce duplicate
inices:

1, null
1, null
null, null
null, null

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?

2339


How to display Row Number with Records in Oracle SQL Plus?

1096


What is the difference between function, procedure and package in pl/sql?

1355


What is the difference between drop and truncate commands?

1113


What is the purpose of primary key?

1073


what is rdbms? : Sql dba

1066


What is denormalization in a database?

1107


Could you please provide oca (oracle 10g) dumps for my certification ?

5244


What are records give examples?

1054


Can you select everything, but 1 or 2 fields, without writer's cramp?

1040


Cite the differences between execution of triggers and stored procedures?

1139


What kind of join is join?

1010


Can there be 2 primary keys in a table?

1046


How to Declare Fixed Length String Value In PL SQL

1207


Describe sql comments?

1115