IN A TABLE HAVE ONE COLUMN PRIMARY KEY..IT WILL NOT ALLOWS
NULL VALUES AND DUPLICATE VALUES..INSTEAD OF PRIMARY KEY
WHY CANT WE USE UNIQUE AND NOT NULL.THESE TWO ALSO DOESNT
ACCEPT NULL VALUES IN NOT NULL AND UNIQUE DOESNT ACCEPT
DUPLICATE VALUES?
SO WHAT IS THE DIFEERENCE BETWEEN(UNIQUE,NOT NULL) AND
PRIMARY KEY??????
Answer Posted / joshy joy
1. Primary key creates Clustered Indexes and they are physically sort the data.
2. Oracle server automatically creates and maintains an index on the primary key and because of that searching will be very fast on that table.
3. Primary can be used for referential integrity when dealing with foreign key in child table
1. Unique can have only Non-clustered indexes, where data are not physically sorted.
2. unique key + not null will not create any index on that column(s)
3. Key column should be Primary key column in parent table when when dealing with foreign key
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does pl sql stand for?
What are local and global variables and their differences?
Why do we create stored procedures & functions in pl/sql and how are they different?
What are few of the schema objects that are created using PL/SQL?
How many subqueries can be nested in a statement?
What are the various restrictions imposed on view in terms of dml?
Can we use loop in sql?
Is sql low level language?
What is dynamic sql in pl sql?
What is sql catalog?
what is the command used to fetch first 5 characters of the string? : Sql dba
What is a mutating table and a constraining table?
What is the difference between alter trigger and drop trigger statements?
how to select unique records from a table? : Sql dba
What is a loop in sql?