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 join types in tsql? : Transact sql
what are the different index configurations a table can have? : Sql dba
Do we need to create index on primary key?
what is error ora-03113: end-of-file on communication channel?
What is pragma in pl sql?
Which sql statement is used to delete data from a database?
What is the difference between a query and a report?
What are sql triggers used for?
What is the process of copying data from table a to table b?
How many postgresql users are there, worldwide?
what is timestamp in mysql? : Sql dba
What is the primary use of normalization?
Explain unique key in sql.
What is localdb mssqllocaldb?
What is pl sql architecture?