<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1021842" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1021842</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1135299</link>
    <description> &lt;p&gt;well. this is my first return since the post. you didn&#039;t kill it. you helped clarify for everyone. i think this might be a candidate for a sticky. it gives a lot of good links and discussion for those new to sql that is helpful in creating a db.&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Jul 2003 15:41:32 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1135299 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134925</link>
    <description> &lt;p&gt;Wow, did I just kill the thread &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;, or solve the problem &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt; ?&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 Jul 2003 21:09:07 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1134925 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134740</link>
    <description> &lt;p&gt;Wow, I wish I could have found this thread earlier...Hopefully the following will help &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt; :&lt;/p&gt;
&lt;p&gt;A primary key is used to provide a unique identifier for a record in the database, you can use anything as this identifier but it is far faster (and takes less memory) if all the RDBMS has to do is match two numbers together; obviously this cannot be null, if null was allowed in this field records could disappear (please say if this needs to be expanded upon &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt; ).&lt;/p&gt;
&lt;p&gt;A field which dis-allows duplicates is not a primary key, therefore there is no reason why null should not be allowed.&lt;br /&gt;
Imagine a form, part of which has an optional field called Post Code, if the user fills in a post code, great but we don&#039;t want the same person signing up twice so it&#039;s only logical that we don&#039;t allow duplicates, but it&#039;s optional so we should allow nulls - otherwise the RDBMS is going to return an error.&lt;/p&gt;
&lt;p&gt;Wow, glad to get that off my chest &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
Hope it helps, also remember that all DB systems are different, what I have said here is based on a working knowledge of Access and MySQL.&lt;/p&gt;
 </description>
     <pubDate>Sat, 19 Jul 2003 16:57:14 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1134740 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134692</link>
    <description> &lt;p&gt;Becarefull there.  You don&#039;t want to make the combination of those two fields to be the primary key... Consider the following:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;+----+----------+&lt;br /&gt;| id | username |&lt;br /&gt;+----+----------+&lt;br /&gt;|&amp;nbsp; 1 | mark&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; 1 | m3rajk&amp;nbsp;&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; 2 | mmi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; 3 | mark&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;+----+----------+&lt;/code&gt;&lt;/div&gt;&#039;In the above table, `id` is not unique, nor is `username`. But the combination of `id` and `username` is unique.&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jul 2003 19:12:50 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1134692 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134682</link>
    <description> &lt;p&gt;lolol. i like ppsd. i thinnk i have that &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;mmi-&lt;/p&gt;
&lt;p&gt;the reason it&#039;s up to those who create the db as to if a unique key can hold a null value depends on how null is done. (undeclared as well)&lt;/p&gt;
&lt;p&gt;if it&#039;s done right it looks like the feild doesn&#039;t exist for that entry.&lt;/p&gt;
&lt;p&gt;but you&#039;re right. it does get confusing... btw: m$ does things like they want, and they screw up everything to boot... ie: winblows 95,98,me,xp,nt1-5,2k ...&lt;/p&gt;
&lt;p&gt;it sounds to me like the db system optimizes seaches for primary keys, since i&#039;m not going to allow 2 people to have the same name i can make that as well as the user identification number be primary keys (probably better to do that. right now i&#039;m trying to get the profile side up, so i&#039;ll think about this in relation to the forum side later.&lt;/p&gt;
&lt;p&gt;thanx for all the links mmi&lt;br /&gt;
and thanx to all for their input. it has helped me figure it out a little better&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jul 2003 16:01:17 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1134682 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I just did--two of &#039;em</title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134595</link>
    <description> &lt;p&gt;Unique Key Largo and Primary Colors&lt;/p&gt;
&lt;p&gt;PPSD - Post-Posting Stress Disorder :eek:&lt;/p&gt;
 </description>
     <pubDate>Thu, 17 Jul 2003 07:19:35 +0000</pubDate>
 <dc:creator>mmi</dc:creator>
 <guid isPermaLink="false">comment 1134595 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134593</link>
    <description> &lt;p&gt;lol@mmi ... I think you&#039;ve done enough researching on this topic.  Stop stressing and go watch a movie. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 17 Jul 2003 06:38:58 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1134593 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Agh! Never should have tried to answer this one.</title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134589</link>
    <description> &lt;p&gt;Most? - All I can gather from that is that M$ db programs don&#039;t?&lt;/p&gt;
&lt;p&gt;But the question I have is: how can more than one row in a relational db have the same value (null or otherwise) and still be a unique identifier?&lt;/p&gt;
&lt;p&gt;I suppose one could argue that the row simply won&#039;t be included in selects or joins or whatever other actions are performed, and so no problems would develop.&lt;/p&gt;
&lt;p&gt;But I&#039;m still left to wonder what is unique about a value (in this case &quot;no value&quot;) that appears in more than one row.&lt;/p&gt;
&lt;p&gt;Here&#039;s an argument that seems to agree with your position:&lt;/p&gt;
&lt;p&gt;&quot;As a unique key can have only one value of each entry and NULL does not have any value, you can argue if a unique key can have NULL-values.&quot;&lt;/p&gt;
&lt;p&gt;from &lt;a href=&quot;http://www.mainframeforum.com/t591525.html&quot; class=&quot;bb-url&quot;&gt;http://www.mainframeforum.com/t591525.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That link didn&#039;t help mme any.&lt;/p&gt;
&lt;p&gt;It looks like you&#039;re right in that it seems to depend on the program. These guys don&#039;t allow it:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.ics.uci.edu/~ics184/netdb2/key.html&quot; class=&quot;bb-url&quot;&gt;http://www.ics.uci.edu/~ics184/netdb2/key.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.rsyntax.com/um_ch034.htm&quot; class=&quot;bb-url&quot;&gt;http://www.rsyntax.com/um_ch034.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.db2.jp/db2manual/en_US/index.htm?openup=admin/c0004799.htm&quot; class=&quot;bb-url&quot;&gt;http://www.db2.jp/db2manual/en_US/index.htm?openup=admin/c0004799.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&#039;s another saying &quot;yes&quot;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://news.dcn-asu.ru/BOOKS/Oracle.Unleashed.Second.Edition/ch02/0025-0028.html&quot; class=&quot;bb-url&quot;&gt;http://news.dcn-asu.ru/BOOKS/Oracle.Unleashed.Second.Edition/ch02/0025-0028.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&quot;Unlike primary keys, unique keys can contain null values.&quot;&lt;/p&gt;
&lt;p&gt;BUT, at the end of that paragraph, they write:&lt;/p&gt;
&lt;p&gt;&quot;... however, for a row that contains a non-null value for the SSN attribute, the value must be unique to the relation.&quot;&lt;/p&gt;
&lt;p&gt;What the heck does &lt;em&gt;&lt;strong&gt;that&lt;/strong&gt;&lt;/em&gt; mean? &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/confused.png&quot; title=&quot;Confused&quot; alt=&quot;Confused&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can&#039;t make any sense of the &quot;Function Based Index Enhancements&quot; in &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.oracle-base.com/Articles/9i/SQLNewFeatures9i.asp&quot; class=&quot;bb-url&quot;&gt;http://www.oracle-base.com/Articles/9i/SQLNewFeatures9i.asp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Well anyway ... I guess you need to base your decision on the software you&#039;re working with. From what I can find:&lt;/p&gt;
&lt;p&gt;IBM&#039;s DB2 - no&lt;br /&gt;
MS - apparently yes&lt;br /&gt;
Oracle - dunno&lt;/p&gt;
&lt;p&gt;E.g., I can&#039;t fine the answer in these:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://news.dcn-asu.ru/BOOKS/Oracle8.How.To/chap6_1.html&quot; class=&quot;bb-url&quot;&gt;http://news.dcn-asu.ru/BOOKS/Oracle8.How.To/chap6_1.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.cse.unsw.edu.au/~cs9804/Oracle/faq.html&quot; class=&quot;bb-url&quot;&gt;http://www.cse.unsw.edu.au/~cs9804/Oracle/faq.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HERE! These guys say &quot;yes&quot; in Oracle:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.emu.edu.tr/english/facilitiesservices/computercenter/bookslib/Oracle%20Unleashed/oun20fi.htm&quot; class=&quot;bb-url&quot;&gt;http://www.emu.edu.tr/english/facilitiesservices/computercenter/bookslib/Oracle%20Unleashed/oun20fi.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&quot;The UNIQUE constraint does not prevent null values from being inserted.&quot;&lt;/p&gt;
 </description>
     <pubDate>Thu, 17 Jul 2003 05:11:19 +0000</pubDate>
 <dc:creator>mmi</dc:creator>
 <guid isPermaLink="false">comment 1134589 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134581</link>
    <description> &lt;p&gt;According to MS:&lt;br /&gt;
&lt;strong&gt;Unique Keys&lt;/strong&gt;&lt;br /&gt;
Unique constraints can allow null values, whereas primary key constraints do not allow null values. Another consideration when deciding whether to use a primary or unique key is that tables can have multiple unique constraints but only one primary key.&lt;/p&gt;
&lt;p&gt;It looks like most db&#039;s will allow a unique key to be a NULL value since NULL doesn&#039;t mean 0, it means nothing.&lt;/p&gt;
 </description>
     <pubDate>Thu, 17 Jul 2003 02:01:17 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1134581 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Oh, for Francis Scott!</title>
    <link>https://www.webmaster-forums.net/web-database-development/primary-key-question#comment-1134561</link>
    <description> &lt;p&gt;I&#039;m no db&#039;er, but according to this doc:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://aurora.vcu.edu/db2help/db2y0/frame3.htm#db2y043&quot; class=&quot;bb-url&quot;&gt;https://aurora.vcu.edu/db2help/db2y0/frame3.htm#db2y043&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&quot;a unique key cannot contain null values&quot;&lt;/p&gt;
&lt;p&gt;And that only makes sense, doesn&#039;t it? I know techies like to play with the language, but if something is &quot;unique&quot; and yet &quot;null&quot; ... &lt;/p&gt;
&lt;p&gt;Well, it would at least seem you couldn&#039;t have it in more than one row of that &quot;key&quot; column.&lt;/p&gt;
 </description>
     <pubDate>Wed, 16 Jul 2003 22:16:35 +0000</pubDate>
 <dc:creator>mmi</dc:creator>
 <guid isPermaLink="false">comment 1134561 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
