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 are the ways on commenting in a pl/sql code?
Why indexing is needed?
How delete all data from all tables in sql?
Can a procedure in a package be overloaded?
Whis is not false in primary key?
What is self-join and what is the requirement of self-join?
i have some prob lem to tell me about my self in interview first round ...
Write an sql query to select all records from the table?
What is the sql*loader? : aql loader
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
How does a trigger work?
Explain the uses of control file.
What is input buffer in sql*plus?
What is on delete restrict?
Does sql full backup truncate logs?