What is the difference between Primary key and
unique index?
Answers were Sorted based on User's Feedback
Answer / rams
Primary Key is Unique and Not Null. Unique index can be defined on Primary Key or any other Unique column in the table. Unique index can have a Null Value unlike Primary Key.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / guest1
Using the Primary Key you can establish referential
integrity. Unix index will be created upon the Primary Key
column, and the data will be seperately placed in the Index
space. If you have not created Unix Index, while accessing
the table it leads to SQLCODE = -540
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / raghunathan
We can have only one Primary Key for a table(including multiple column) but can have any number of unique indexes in a table( limited to number of columns in that table)
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / guest
The primary key is used to establish referential integrity
relationship with another table and a Unique index is used
to to enforce uniqueness.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / sunny kalra
Primary key: a relational database constraint. Primary key consists of one or more
columns that uniquely identify a row in the table. For a normalized relation, there
is one designated primary key.
Unique index: a physical object that stores only unique values. There can be one
or more unique indexes on a table.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ankit
IN PRIMARY KEY WE DO NOT ATTACH UNIQUE INDEX BUT IN UNIQUE
INDEX WE CAN ATTACH PRIMARY KEY
| Is This Answer Correct ? | 1 Yes | 5 No |
Which transaction use a command thread ?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
What is sqlcode -811?
7 Answers Accenture, CTS, TCS,
How many Buffer pools are there in DB2 and what are they?
How we create a tables in DB2 ?Previously client has using 7 letters for user id,now he wants to increase the letters from 7 to 12 for user id.How we can do it?
What are concurrency issues?
a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.
db2 maintains information about the data... a.in tables. b.in a set of tables known as db2 catalog. c.in db2 database. d.none of the above.
Which DB2 catalog tables are used to produce a list of table column by table for all tables in a database?
How to fetch the uncommited data from table ?
What is coalesce in db2?
What is host variable?