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

Answer Posted / pratibha

u can insert multiple null values without ant error:

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

Table created.

SQL> insert into sab values('&sab');
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> SQL> select count(*) from sab;

COUNT(*)
----------
5

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are conditional predicates?

583


What is pl sql in oracle?

574


Name the different types of indexes in sql and define them.

565


What is the difference between nested table and varray?

514


Is pl sql useful?

537






what does it mean to have quoted_identifier on? : Sql dba

673


What are types of joins?

532


Does inner join return duplicate rows?

516


Is primary key an index?

531


Why do we use procedures in sql?

544


What are the rules to be applied to nulls whilst doing comparisons?

750


What is date functions?

572


how many values can the set function of mysql take? : Sql dba

530


I need a function for a train ticket reservation please answer it thanks in advance

560


What is the best partition size for windows 10?

477