If a table column has is UNIQUE and has NOT NULL, is it
equivalent to a PRIMARY KEY column?
Answers were Sorted based on User's Feedback
Answer / prashant t.
No.
It will same for doesn't allow null and duplicate values.
But, Primary key constrained applied Cluster index on that
column and unique key constraint non clustered index on
that column. that is the major differece still be there.
Is This Answer Correct ? | 20 Yes | 1 No |
Answer / bhakti
yes it is equivalent as primary key is nothing but unique
and not null.
Is This Answer Correct ? | 16 Yes | 6 No |
Answer / bhakti
ya thats true.i.e.,in case of Primary Key we can have
parent to child relationship if that is say foreign key in
another table.In case of unique and not null we cant achive
dis.
But while inserting data into one table both will have no
difference.
Is This Answer Correct ? | 7 Yes | 4 No |
Answer / eshwari
ur question is not clear.
if ur saying that ur giving unique and not null constraints
to the same column then u can make it as primary key.it
internally supports clustered index also.
if ur saying that ur giving unique and not null constraints
to different columns then u cant make them as primary key
individually.
coz primary key means unique + notnull + clustered index
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / dibya tara shakya
It will same but in case of primary key we can create the
master child relationship with other child table as foreign
key but in case of unique and not null we cannot.
another major difference is that Primary key constraint
applied Cluster index on that
column and unique key constraint non clustered index on
that column.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sujith
no it is not.......... you may have some other columns which
have not null and unique constraints on it..... the thing is
that you should explicitly choose which one should be
treated as primary key so that clustered index can be put on
it, and non clustered on others where needed.........
foreign key may be used to refer to unique constraint
column, but while dropping you may loose relative unique
constraint also.. where as in case of primary referred by
foreign, will not allow so to happen............
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / amit
if that so then your referential entrigity will be spoil
foreign key will not be recognised means data will not true.
Is This Answer Correct ? | 5 Yes | 8 No |
how to find find & delete duplicate rows from two different tables?
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
How to insert a new row into a table in oracle?
what is the use of composite key constraint?
How a tablespace is related to data files?
What is SQL access advisor in Oracle?
i wrote a pl/sql procedure. it must run every sunday 4.40 How can i schedule it with the help of dbms_jobs (or another other procedure with out creating bat file,exe file)
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
Give the various exception types.
A VIEWS takes memory in the database. If yes, how can u proove it? is there any way to display the size of views?
Give syntax for SQL and ORACLE joins.
Can we insert data in view oracle?