what is the different between unique+not null & primary key,
Answers were Sorted based on User's Feedback
Answer / sreekumar
In a relation, we can create only one primary key where as we can create multiple unique+not null constrains.
Primary key uses clustered index where are unique +Not null uses non clustered index.
Sreekumar
Is This Answer Correct ? | 18 Yes | 1 No |
Answer / suresh babu
Unique:
Unique is a constraint,which doesn't allow the duplicate
values and allow only one null value.We can create more
number of unique constraint in single table.
Not Null:
Not Null constraint,which doesn't allow the Null values and
allow the duplicate values.
Primary Key:
We can create one primary key for a table,Which doesn't
allow the duplicate and null values,and used for make a
foreign key relation.we can't do this process using above
two constraints.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / mohan babu
A unique key is nothing but it does not allow any
duplicateds but allows nullvalues
A primary key is nothing but it does not allow duplicates
as well as Null values i.e Not Nulls
Is This Answer Correct ? | 5 Yes | 5 No |
Answer / giri
unique:it does not allow duplicate values but it allow null values.
not null:It does not allow null values but allow duplicate values.
primary:It does not allow both duplicate and null values.
Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by temporal data?
Is postgresql a server?
Explain clause in sql?
What is a mutating table and a constraining table?
What are the operators in sql?
What are sql triggers used for?
Which one is the Best approach to put code, among Triggers and Procedures? Explain?
Can we debug stored procedure?
what is acid property in database? : Sql dba
Please let me know if UNION ALL and Natural Join does the same operation and are same...
What is primary key secondary key alternate key candidate key?
What is compound trigger?