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 where 1 1 mean in sql?
What are the different types of dbmss?
What is trigger and types?
Explain the types of joins in sql?
What is compiled query?
What is a relationship and what are they?
How do you create a unique index?
Which is faster subquery or join?
In pl/sql, what is bulk binding, and when/how would it help performance?
Why are cursors used?
What is the difference between rollback and rollback to statements?
How to return multiple rows from the stored procedure?
Why use triggers in sql?
What is a temporal data type?
What are the events on which a database trigger can be based?