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 is the most restrictive isolation level? : Transact sql

558


What is partition in sql query?

519


Write a query to display the current date in sql?

516


Does truncate table reset auto increment?

528


What is dialect in sql?

527






What are analytical functions in sql?

545


What are the uses of sysdate and user keywords?

631


What is null in pl/sql?

626


Can we edit a view in sql?

550


what is the syntax used for partition in tsql? : Transact sql

541


What is the maximum number of triggers, you can apply on a single table?

544


What is oracle pl sql developer?

532


What is the difference between mdf and ndf files?

573


What is the order of sql select?

573


How can we optimize a sql query?

577