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 / amit rajoria

Yes, we can use multiple Null values in case of Unique Key
Column. This is one the main difference between Unique Key
and Primary Key that Unique Key always allows multiple
entries of Null Statement where as Primary Key never allows
this.

I am hereby giving you a very very basic example which
suggests that Unique Key can have more than one Null
Statement :-

SQL> create table abcd(name varchar2(10) unique);

Table created.

**********************

Now insert the values :-

SQL> insert into abcd(name)values('amit');

1 row created.

SQL> insert into abcd(name)values('ami');

1 row created.

SQL> insert into abcd(name)values(null);

1 row created.

SQL> insert into abcd(name)values(null);

1 row created.

SQL> insert into abcd(name)values(null);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from abcd;

NAME
----------
amit
ami



Here blank space above represents the entries of null
statements..!!

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql clause?

992


What are the ddl commands?

947


What are the different types of triggers?

1051


Explain the the update statement in sql?

986


What is the most common sql injection tool?

991


What is forward declaration in pl sql?

1005


What is the usage of sql functions?

1073


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

1175


How to look at the current sql*plus system settings?

1076


What is package in pl sql with an examples?

967


Can you join views in sql?

896


How do I run a pl sql procedure in sql developer?

911


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

968


How do you change a value in sql?

964


Which is the correct statement about truncate and delete?

1032