what is difference between "Primary key" and "Unique key"?
Answers were Sorted based on User's Feedback
Answer / swapna
1)unique key can be null but primariy key cant be null.
2)primariy key can be refrenced to other table as FK.
Primary key and unique are Entity integrity constraints
Primary key allows each row in a table to be uniquely
identified and ensures that no duplicate rows
exist and no null values are entered.
Unique key constraint is used to prevent the duplication of
key values within the rows of a table and allow null
values. (In oracle, one null is not equal to another null).
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / satya_k21
Hi,
Primary Key: Not Null+ unique.but it wont allows null
values.
Unique: It allows null values , but it should be unique.
Regards,
Satya.k
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nitin gupta
Uniques: Enforce unique data in the database
it allows row containing null value but only once
It implements non clustered index.
primary key: Enforce unique data in the database
it don't allow any record containing null value
it implements clustered index (data physically
sorted)
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kk
PRIMARY KEY=UNIQUE KEY+ NOT NULL KEY so its a combo drive
Is This Answer Correct ? | 1 Yes | 2 No |
what are the authentication modes in sql server? How can it be changed? : Sql dba
What are the benefits of pl sql?
What is difference between ms sql and mysql?
how to remove records from table? no name 1 a 2 b 1 a 2 b 3 c
How we get all_group_function's(Sum,avg,count,max and min_value of a column(Sal) Using pl/sql anonymous block, with out using group function's. You shouldn't use more than one select statement in entire the program. Like cursor c is select * from <table_name>; except this you can't use another select statement. You can use no of variables as per requirement.
HOW TO TUNE ORACLE SQL QUERIES GIVE ME STEP BY SREP
What is a scalar value in sql?
how to enter binary numbers in sql statements? : Sql dba
What are the types of records?
What is trigger with example?
How many database objects (trigger, packages, sequence etc) uses a particular field in a given table. For ex: I want to know how many database object uses the ATTRIBUTE1 in the PO_VENDORS table. What query will give me the result showing the database object name(package, trigger etc), field_name used (in this case ATTRIBUTE1) and table_name (in this case PO_VENDORS).
what is difference between procedure and function, procedure and trigger?