tag:blogger.com,1999:blog-723572961554940315.post4713047937359042491..comments2023-10-08T19:26:21.745+05:30Comments on Ask Anantha: What is difference between UNIQUE and PRIMARY KEY constraintsAnantha Narayananhttp://www.blogger.com/profile/01235733287809115092noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-723572961554940315.post-16456257243721139082012-10-22T09:27:48.810+05:302012-10-22T09:27:48.810+05:30That's add value to any one's knowledge of...That's add value to any one's knowledge of PK and UK. worth including in my list of <a href="http://java67.blogspot.it/2012/10/difference-between-primary-vs-unique-key-table-sql.html" rel="nofollow">differences between primary and unique key</a>.Java programmerhttp://java67.blogspot.twnoreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-866173910662926522012-06-08T11:35:10.274+05:302012-06-08T11:35:10.274+05:30Refer this for the wonderful information on UK and...Refer this for the wonderful information on UK and PK<br />http://tsqltips.blogspot.com/Anonymoushttps://www.blogger.com/profile/15786017588088913856noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-68527267818237443522011-06-30T18:10:42.047+05:302011-06-30T18:10:42.047+05:30Hope this article lists out difference of both and...Hope this article lists out difference of both and this is what you are looking for:<br /><br />http://www.dba-oracle.com/t_iot_index_organized_table.htmAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-38956415709819932002011-06-23T17:34:17.068+05:302011-06-23T17:34:17.068+05:30Hi Anantha,
If I create a Primary key it will crea...Hi Anantha,<br />If I create a Primary key it will create cluster index. we can define IOT while define Primary key constraints on particular columns. Kindly let me know the difference between the both indexes.<br />Thanks,<br />GireeshGireeshhttps://www.blogger.com/profile/00047903240534078436noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-5564270450542957652009-01-24T17:23:00.000+05:302009-01-24T17:23:00.000+05:30You can have Unique key with clustered index. So t...You can have Unique key with clustered index. So there is no difference in Primary and Unique key. You answers are not satisfactoryAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-12976071281290341162008-08-11T18:18:00.000+05:302008-08-11T18:18:00.000+05:30Given in a very clear and concise way.ThanksGiven in a very clear and concise way.<BR/><BR/>ThanksGShttps://www.blogger.com/profile/02893580182188516939noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-53360074579752417742008-04-21T18:34:00.000+05:302008-04-21T18:34:00.000+05:30There will be performance improvements if:1. The t...There will be performance improvements if:<BR/>1. The table has columns which are unique but already has a primary key<BR/><BR/>2. The table has not millions of records (If this were the case, the DML operations would take more time)<BR/><BR/>3. Though Primary key can be used for both keys (UNIQUE, NOT NULL), if already there is a Primary key in the table then it is not possible to create one Anantha Narayananhttps://www.blogger.com/profile/01235733287809115092noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-51898391009922516992008-04-20T23:49:00.000+05:302008-04-20T23:49:00.000+05:30Would there be any performance improvements if we ...Would there be any performance improvements if we have both Primary and Unique Key? Primary Key can serve the purpose of both the Keys. Please clarify on this.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-58726646743381614832008-03-28T21:34:00.000+05:302008-03-28T21:34:00.000+05:30First create a table which will be used to test Pr...First create a table which will be used to test Primary key:<BR/><BR/>CREATE TABLE test_pkey (primary_key_field NUMBER PRIMARY KEY);<BR/><BR/>Secondly create a table which will be used to test Unique key:<BR/><BR/>CREATE TABLE test_ukey (unique_key_field NUMBER UNIQUE);<BR/><BR/>Now query the constraints which are created:<BR/><BR/>SELECT TABLE_NAME,CONSTRAINT_TYPE,CONSTRAINT_NAME FROM Anantha Narayananhttps://www.blogger.com/profile/01235733287809115092noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-82311922699726124802008-03-28T16:37:00.000+05:302008-03-28T16:37:00.000+05:30Can you please show me the difference between prim...Can you please show me the difference between primary key and unique key with example?Unknownhttps://www.blogger.com/profile/10626154974031138116noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-60477964224862027512008-03-27T22:20:00.000+05:302008-03-27T22:20:00.000+05:30If you give unique key + not null, then the differ...If you give unique key + not null, then the difference will be in the way the non-clustered index is maintained.Anantha Narayananhttps://www.blogger.com/profile/01235733287809115092noreply@blogger.comtag:blogger.com,1999:blog-723572961554940315.post-57640224642438567562008-03-22T19:33:00.000+05:302008-03-22T19:33:00.000+05:30what will happen if u give unique key and not null...what will happen if u give unique key and not null as a constraint?vijihttps://www.blogger.com/profile/16750996418101720936noreply@blogger.com