Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REGARDING PRIMARY KEY AND UNIQUE KEY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue Oct 05, 2004 1:17 pm    Post subject: REGARDING PRIMARY KEY AND UNIQUE KEY
Reply with quote

Hai

i want difference b/w primary key and unique key.

maximum number of primary key's for a table.

ashwin
Back to top
View user's profile Send private message

anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Oct 05, 2004 1:32 pm    Post subject:
Reply with quote

Hi Ashwin,

Unique key in the sense it will not have any value repeated to that particular key but primary key(also unique) makes the total row unique.

Thanks,
Anu
Back to top
View user's profile Send private message
unna

New User


Joined: 15 Oct 2004
Posts: 17

PostPosted: Fri Oct 15, 2004 2:45 pm    Post subject:
Reply with quote

Hi,
I Suppose Primary key and unique key both mean the same .
Primary key is used for unique identification of a row and should not
have null values. There can be only one primary key for a table.

Thanks,
Back to top
View user's profile Send private message
veerababu

New User


Joined: 07 Nov 2004
Posts: 3

PostPosted: Sun Nov 07, 2004 1:44 pm    Post subject: Re: REGARDING PRIMARY KEY AND UNIQUE KEY
Reply with quote

The main Difference is that

Primary key means ----- No Duplicates and No Nulls.


Unique key means ------ No Duplicates but Allows Nulls.
Back to top
View user's profile Send private message
veerababu

New User


Joined: 07 Nov 2004
Posts: 3

PostPosted: Sun Nov 07, 2004 1:48 pm    Post subject: Re: REGARDING PRIMARY KEY AND UNIQUE KEY
Reply with quote

Hi,

veerababu wrote:
The main Difference is that

Primary key means ----- No Duplicates and No Nulls.


Unique key means ------ No Duplicates but Allows Nulls.



Thanks,

vb
Back to top
View user's profile Send private message
ksivapradeep

New User


Joined: 30 Jul 2004
Posts: 95

PostPosted: Mon Nov 08, 2004 10:44 am    Post subject: Re: REGARDING PRIMARY KEY AND UNIQUE KEY
Reply with quote

hello veera babu,

i think another diff b/w pkey and ukey is we can create more than one primary for a table and we cant create more than one ukey for a table is it correct r not.

regards,
siva pradeep
Back to top
View user's profile Send private message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Sat Feb 19, 2005 2:44 pm    Post subject: hi ashwin
Reply with quote

the difference between unique and primary key is

primary key : notnull and unique

unique key is : avoids duplicates only.

more over one table can have only one primary key but more than one unique indexes.

any thing wrong or missed let me know.

Regards,
Pavan
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts SFTP to primary and secondary servers mallik4u JCL & VSAM 4 Tue Jun 07, 2016 12:52 pm
No new posts Unique sort situation.... dbecker SYNCSORT 6 Wed Apr 27, 2016 8:53 pm
No new posts Unique Record Count anandhan87 DFSORT/ICETOOL 1 Tue Feb 09, 2016 4:06 pm
No new posts unique 8 character token Pedro CLIST & REXX 9 Fri May 08, 2015 10:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us