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 is procedure function?
Explain unique key in sql.
what is a relationship and what are they? : Sql dba
What are the types of views in sql?
What is trigger and stored procedure in sql?
Explain architecture of sql server notification services?
What is pl sql and why it is used for?
What are all types of user defined functions?
what is sql? : Sql dba
Explain the difference between triggers and constraints?
what happens if null values are involved in expressions? : Sql dba
What is the purpose of primary key?
What is varchar used for?
What does pl sql stand for?
Compare sql & pl/sql