<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Database Naming: A response</title>
	<atom:link href="http://blog.robwhelan.com/2008/01/25/database-naming-a-response/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/</link>
	<description>overthink backscatter</description>
	<lastBuildDate>Sat, 24 Dec 2011 07:22:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Robert Williams</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-3568</link>
		<dc:creator>Robert Williams</dc:creator>
		<pubDate>Sat, 21 Feb 2009 06:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-3568</guid>
		<description>Does anyone know where I can find more information about this?</description>
		<content:encoded><![CDATA[<p>Does anyone know where I can find more information about this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-19</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Wed, 30 Jan 2008 18:53:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-19</guid>
		<description>@Tim: &lt;em&gt;&quot;Scary to agree so much&quot;&lt;/em&gt;
I agree.  No!  I disagree!  Huh.  &quot;This statement is false.&quot;  Hey, that&#039;s a nice-looking naming guide.

@mikeh: I&#039;ve done that before, actually!  I had a table for key values, with columns something like pk_name, value, chunk_size, max_value, then a singleton SequenceManager that would claim PKs from the table in &quot;chunk_size&quot; chunks, dole them out as needed, send email warnings if we were approaching the max_value, and reset the sequence back to 1 when it hit the max.

In retrospect, though, I wouldn&#039;t recommend it.  The design was simple; implementing the code was trickier, and we did have some subtle bugs show up -- that singleton object that doles out the IDs needed to be threadsafe but couldn&#039;t lock out *all* PK requests when it needed to claim a new chunk for just one stack (welcome to concurrency tricks).  Now cluster the app servers, so each server has its *own* SequenceManager, and they have to play nicely even when refreshing at the same time....

The biggest problem is reimplementing all of the features of sequences that are nowadays very likely built into the database already.  That project was working with DB2400; I don&#039;t remember what it had (and possibly didn&#039;t know at the time...).  But at least in Oracle, this is *all* stuff the sequence can do for you (even pre-claiming chunks of N at a time) so getting a new PK is really going to be extremely fast... very unlikely to be near the top of performance hotspots, and thus not a candidate for a bunch of complex custom code.</description>
		<content:encoded><![CDATA[<p>@Tim: <em>&#8220;Scary to agree so much&#8221;</em><br />
I agree.  No!  I disagree!  Huh.  &#8220;This statement is false.&#8221;  Hey, that&#8217;s a nice-looking naming guide.</p>
<p>@mikeh: I&#8217;ve done that before, actually!  I had a table for key values, with columns something like pk_name, value, chunk_size, max_value, then a singleton SequenceManager that would claim PKs from the table in &#8220;chunk_size&#8221; chunks, dole them out as needed, send email warnings if we were approaching the max_value, and reset the sequence back to 1 when it hit the max.</p>
<p>In retrospect, though, I wouldn&#8217;t recommend it.  The design was simple; implementing the code was trickier, and we did have some subtle bugs show up &#8212; that singleton object that doles out the IDs needed to be threadsafe but couldn&#8217;t lock out *all* PK requests when it needed to claim a new chunk for just one stack (welcome to concurrency tricks).  Now cluster the app servers, so each server has its *own* SequenceManager, and they have to play nicely even when refreshing at the same time&#8230;.</p>
<p>The biggest problem is reimplementing all of the features of sequences that are nowadays very likely built into the database already.  That project was working with DB2400; I don&#8217;t remember what it had (and possibly didn&#8217;t know at the time&#8230;).  But at least in Oracle, this is *all* stuff the sequence can do for you (even pre-claiming chunks of N at a time) so getting a new PK is really going to be extremely fast&#8230; very unlikely to be near the top of performance hotspots, and thus not a candidate for a bunch of complex custom code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikeh</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-18</link>
		<dc:creator>mikeh</dc:creator>
		<pubDate>Wed, 30 Jan 2008 18:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-18</guid>
		<description>Another option not discussed is to use a &quot;Counter&quot; table (VERY old school, but effective for many scenarios).  Grab the next value for a PK int field via a stored proc, which increments the counter value when reading.  One of the advantages of this is being able to reserve a range of consecutive values in advance.  By using a char pk instead of an int you can even &quot;namespace&quot; your counter table values so different registered databases will not create overlapping ids (ie: &quot;AAA000000001&quot;, &quot;AAA000000001&quot;)</description>
		<content:encoded><![CDATA[<p>Another option not discussed is to use a &#8220;Counter&#8221; table (VERY old school, but effective for many scenarios).  Grab the next value for a PK int field via a stored proc, which increments the counter value when reading.  One of the advantages of this is being able to reserve a range of consecutive values in advance.  By using a char pk instead of an int you can even &#8220;namespace&#8221; your counter table values so different registered databases will not create overlapping ids (ie: &#8220;AAA000000001&#8243;, &#8220;AAA000000001&#8243;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-17</link>
		<dc:creator>Tyler</dc:creator>
		<pubDate>Wed, 30 Jan 2008 18:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-17</guid>
		<description>Fucking eh! Good read.</description>
		<content:encoded><![CDATA[<p>Fucking eh! Good read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-16</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 30 Jan 2008 18:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-16</guid>
		<description>Let&#039;s see how many of my naming rules (&lt;a href=&quot;http://tottinge.blogsome.com/meaningfulnames/&quot; rel=&quot;nofollow&quot;&gt;http://tottinge.blogsome.com/meaningfulnames/&lt;/a&gt;) dzone wants us to break ....

I think only four.  That&#039;s better than the average legacy code base, but could be better, I think.   

I prefer non-space names, underscore-enriched, no warts or prefixes, no concern for plural v. singular in table names (be consistent only), totally agree with Rob on #6, and I don&#039;t particularly like guids for IDs.  

Scary to agree so much.</description>
		<content:encoded><![CDATA[<p>Let&#8217;s see how many of my naming rules (<a href="http://tottinge.blogsome.com/meaningfulnames/" rel="nofollow">http://tottinge.blogsome.com/meaningfulnames/</a>) dzone wants us to break &#8230;.</p>
<p>I think only four.  That&#8217;s better than the average legacy code base, but could be better, I think.   </p>
<p>I prefer non-space names, underscore-enriched, no warts or prefixes, no concern for plural v. singular in table names (be consistent only), totally agree with Rob on #6, and I don&#8217;t particularly like guids for IDs.  </p>
<p>Scary to agree so much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-15</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 30 Jan 2008 14:49:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-15</guid>
		<description>I prefer to have my table names plural.  The reason is because a table is actually a set of like items.  So even though the individual item name would be Customer, when you select from a table, your actually returning Customers.  If you look at what your actually doing logically, you wouldn&#039;t want to say Customer-&gt;Customer[0]-&gt;id, Customers-&gt;Customer[0]-&gt;id just makes more sense.

As for table prefixes, leave them out.  They limit your ability to turn tables into views and vice-versa if your requirement later change.  Then for linking tables I usually use something like CustomersAddressesMap.</description>
		<content:encoded><![CDATA[<p>I prefer to have my table names plural.  The reason is because a table is actually a set of like items.  So even though the individual item name would be Customer, when you select from a table, your actually returning Customers.  If you look at what your actually doing logically, you wouldn&#8217;t want to say Customer-&gt;Customer[0]-&gt;id, Customers-&gt;Customer[0]-&gt;id just makes more sense.</p>
<p>As for table prefixes, leave them out.  They limit your ability to turn tables into views and vice-versa if your requirement later change.  Then for linking tables I usually use something like CustomersAddressesMap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liam</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-14</link>
		<dc:creator>Liam</dc:creator>
		<pubDate>Wed, 30 Jan 2008 09:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-14</guid>
		<description>I actually fall under a different philosophy for singular/plural table names, but it still often leads me to calling the tables singular:

&quot;The name of a table should describe one row of the table.&quot;

So, a table of customers would be called &#039;customer&#039;, a crosswalk table between customers and companies would be &#039;customer_company&#039;, and one where each row was a matrix of companies would be &quot;companies&quot;.  In practice, I&#039;ve only ever found singular table rows, however.</description>
		<content:encoded><![CDATA[<p>I actually fall under a different philosophy for singular/plural table names, but it still often leads me to calling the tables singular:</p>
<p>&#8220;The name of a table should describe one row of the table.&#8221;</p>
<p>So, a table of customers would be called &#8216;customer&#8217;, a crosswalk table between customers and companies would be &#8216;customer_company&#8217;, and one where each row was a matrix of companies would be &#8220;companies&#8221;.  In practice, I&#8217;ve only ever found singular table rows, however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-13</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 28 Jan 2008 23:05:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-13</guid>
		<description>@karthik: I&#039;m not sure about the options for Hibernate bulk inserts, though I suspect you&#039;d be surprised at how fast pulling 1000 id&#039;s from a sequence would be over an open connection (much faster than reading from a table on the disk, for example...).  I haven&#039;t hit the situation, though -- I&#039;ve never used Hibernate for bulk data moves; it&#039;s always seemed much more appropriate for application-style work with generally small numbers of objects at a time.

WRT your second point -- what were the reasons for using the GUID PK in the first place?  It sounds like you had two separate primary keys in that situation (one as the &quot;real&quot; PK, one to operate as a readable identifier and foreign key), which would be confusing, so I imagine there were reasons for needing them both.

The prefix argument I still don&#039;t buy.  Are there good reasons for sharing a single database schema for multiple applications?  You can always leave them in the same database instance for reasons of simple backups, perhaps shared data, etc.; just put them in different schemas, then (you can still hit both schemas from one DB connection, but they won&#039;t be stepping on each others toes)... that also makes it easier to move them to separate servers later as they grow, which seems more likely than that you&#039;d be adding more applications to a single schema.  And If I want to import tables from another database, well, I&#039;d tweak the incoming data however I needed to make it consistent with the &quot;home&quot; schema.  There&#039;s some minor extra work involved in renaming the tables, columns, etc. to match the existing standards, but it&#039;s a rare enough situation that I wouldn&#039;t worry about it.

@ME: Yes, programming languages like you mentioned &lt;b&gt;are&lt;/b&gt; case-sensitive; but SQL by default and historically is &lt;b&gt;not&lt;/b&gt;... you can &lt;code&gt;select * from CUSTOMER&lt;/code&gt; or &lt;code&gt;SELECT * fRom custoMER&lt;/code&gt; and it&#039;ll work either way.

I believe there&#039;s support nowadays for using case-sensitive table names in most databases, but it seems to be problematic (partly because of the history of case-insensitivity affects tool assumptions).

So you can do it, but it&#039;s not the &quot;norm&quot; and I am arguing that it isn&#039;t worth the trouble.</description>
		<content:encoded><![CDATA[<p>@karthik: I&#8217;m not sure about the options for Hibernate bulk inserts, though I suspect you&#8217;d be surprised at how fast pulling 1000 id&#8217;s from a sequence would be over an open connection (much faster than reading from a table on the disk, for example&#8230;).  I haven&#8217;t hit the situation, though &#8212; I&#8217;ve never used Hibernate for bulk data moves; it&#8217;s always seemed much more appropriate for application-style work with generally small numbers of objects at a time.</p>
<p>WRT your second point &#8212; what were the reasons for using the GUID PK in the first place?  It sounds like you had two separate primary keys in that situation (one as the &#8220;real&#8221; PK, one to operate as a readable identifier and foreign key), which would be confusing, so I imagine there were reasons for needing them both.</p>
<p>The prefix argument I still don&#8217;t buy.  Are there good reasons for sharing a single database schema for multiple applications?  You can always leave them in the same database instance for reasons of simple backups, perhaps shared data, etc.; just put them in different schemas, then (you can still hit both schemas from one DB connection, but they won&#8217;t be stepping on each others toes)&#8230; that also makes it easier to move them to separate servers later as they grow, which seems more likely than that you&#8217;d be adding more applications to a single schema.  And If I want to import tables from another database, well, I&#8217;d tweak the incoming data however I needed to make it consistent with the &#8220;home&#8221; schema.  There&#8217;s some minor extra work involved in renaming the tables, columns, etc. to match the existing standards, but it&#8217;s a rare enough situation that I wouldn&#8217;t worry about it.</p>
<p>@ME: Yes, programming languages like you mentioned <b>are</b> case-sensitive; but SQL by default and historically is <b>not</b>&#8230; you can <code>select * from CUSTOMER</code> or <code>SELECT * fRom custoMER</code> and it&#8217;ll work either way.</p>
<p>I believe there&#8217;s support nowadays for using case-sensitive table names in most databases, but it seems to be problematic (partly because of the history of case-insensitivity affects tool assumptions).</p>
<p>So you can do it, but it&#8217;s not the &#8220;norm&#8221; and I am arguing that it isn&#8217;t worth the trouble.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ME</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-12</link>
		<dc:creator>ME</dc:creator>
		<pubDate>Mon, 28 Jan 2008 22:23:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-12</guid>
		<description>On the case sensitivity: This has been the case in programming languages for donkeys years (C -&gt; C++ -&gt; Java etc. ) and programmers handle mixed case names fine.

Yes the DB may be case sensitive, so you have to  write SQL in the correct case by following the naming convention.

People not following a convention is not an argument against the convention.</description>
		<content:encoded><![CDATA[<p>On the case sensitivity: This has been the case in programming languages for donkeys years (C -&gt; C++ -&gt; Java etc. ) and programmers handle mixed case names fine.</p>
<p>Yes the DB may be case sensitive, so you have to  write SQL in the correct case by following the naming convention.</p>
<p>People not following a convention is not an argument against the convention.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-11</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 28 Jan 2008 20:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-11</guid>
		<description>You absolutely do not have to escape table or column names that contain underscores in MySQL, I&#039;m not sure what JGM is talking about.

I agree with all your points; just I tend to use &quot;id&quot; rather than &quot;tablename_id&quot;, and as I do a fair bit of Rails work I tend to use pluralized forms nowadays - Rails has a reasonably comprehensive singular  plural form function to do all the hard work. Makes you wonder why they bothered, but oh well.

http://svn.rubyonrails.org/rails/trunk/activesupport/lib/active_support/inflections.rb</description>
		<content:encoded><![CDATA[<p>You absolutely do not have to escape table or column names that contain underscores in MySQL, I&#8217;m not sure what JGM is talking about.</p>
<p>I agree with all your points; just I tend to use &#8220;id&#8221; rather than &#8220;tablename_id&#8221;, and as I do a fair bit of Rails work I tend to use pluralized forms nowadays &#8211; Rails has a reasonably comprehensive singular  plural form function to do all the hard work. Makes you wonder why they bothered, but oh well.</p>
<p><a href="http://svn.rubyonrails.org/rails/trunk/activesupport/lib/active_support/inflections.rb" rel="nofollow">http://svn.rubyonrails.org/rails/trunk/activesupport/lib/active_support/inflections.rb</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karthik</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-10</link>
		<dc:creator>karthik</dc:creator>
		<pubDate>Mon, 28 Jan 2008 17:59:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-10</guid>
		<description>I think the performance benefit of knowing the primary key is in a specialized use - most frequently observed when using a tool such as Hibernate. If you are attempting to write a 1000 rows into a table in a batch and your PK is an Oracle sequence, Hibernate will execute a 1000 select ... dual before it writes the rows. With a GUID, Hibernate can generate the key on the client side.

I see your point about the readability of GUIDs. However, I think there is benefit to using GUIDs for certain PKs. I&#039;ve successfully used GUID as the pk and a sequence as a surrogate key (populated with a trigger) and had the surrogate key as the foreign key elsewhere. 

For table names, it makes sense to ALWAYS use a prefix - sometimes you have tables from another app migrated into yours - it helps to easily distinguish between table sets then. I always use a TLA - 2 letters identifying the application and one for sub module. So for a bulletin board app, table prefixes may be BBS for system tables, BBU for user tables, BBM for message tables, etc.</description>
		<content:encoded><![CDATA[<p>I think the performance benefit of knowing the primary key is in a specialized use &#8211; most frequently observed when using a tool such as Hibernate. If you are attempting to write a 1000 rows into a table in a batch and your PK is an Oracle sequence, Hibernate will execute a 1000 select &#8230; dual before it writes the rows. With a GUID, Hibernate can generate the key on the client side.</p>
<p>I see your point about the readability of GUIDs. However, I think there is benefit to using GUIDs for certain PKs. I&#8217;ve successfully used GUID as the pk and a sequence as a surrogate key (populated with a trigger) and had the surrogate key as the foreign key elsewhere. </p>
<p>For table names, it makes sense to ALWAYS use a prefix &#8211; sometimes you have tables from another app migrated into yours &#8211; it helps to easily distinguish between table sets then. I always use a TLA &#8211; 2 letters identifying the application and one for sub module. So for a bulletin board app, table prefixes may be BBS for system tables, BBU for user tables, BBM for message tables, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-9</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 28 Jan 2008 16:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-9</guid>
		<description>@JGM: I don&#039;t follow -- you can write a query with a wildcard in the &lt;b&gt;table name&lt;/b&gt;?  I&#039;ve only ever heard of wildcards in something like &quot;select * from table where name like &#039;Jo_&#039;; ...where that would return values like Jon/Job/etc..

But that&#039;s only values, not table or column names.

Can you give an example of where that could be a problem?  I done a few projects using MySQL, but I&#039;ve never heard of this issue before.</description>
		<content:encoded><![CDATA[<p>@JGM: I don&#8217;t follow &#8212; you can write a query with a wildcard in the <b>table name</b>?  I&#8217;ve only ever heard of wildcards in something like &#8220;select * from table where name like &#8216;Jo_&#8217;; &#8230;where that would return values like Jon/Job/etc..</p>
<p>But that&#8217;s only values, not table or column names.</p>
<p>Can you give an example of where that could be a problem?  I done a few projects using MySQL, but I&#8217;ve never heard of this issue before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JGM</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-7</link>
		<dc:creator>JGM</dc:creator>
		<pubDate>Mon, 28 Jan 2008 14:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-7</guid>
		<description>Just my personal preference, but I avoid all underscores in names on MySQL as this is a wildcard character.  I prefer not to have to escape table or field names to prevent pattern matching.</description>
		<content:encoded><![CDATA[<p>Just my personal preference, but I avoid all underscores in names on MySQL as this is a wildcard character.  I prefer not to have to escape table or field names to prevent pattern matching.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-6</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 28 Jan 2008 13:07:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-6</guid>
		<description>Ha!  I was digging around online to see what other arguments there were for singular vs. plural table names, and ran across &lt;a href=&quot;http://channel9.msdn.com/ShowPost.aspx?PostID=159232#159232&quot; rel=&quot;nofollow&quot;&gt;a brilliant suggestion&lt;/a&gt;: just choose table names that are nouns with the same form for plural and singular!  Examples:
  aircraft
  sheep
  deer
  cannon
  fish

It, ah, perhaps limits your options a bit, but it certainly resolves the issue!</description>
		<content:encoded><![CDATA[<p>Ha!  I was digging around online to see what other arguments there were for singular vs. plural table names, and ran across <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=159232#159232" rel="nofollow">a brilliant suggestion</a>: just choose table names that are nouns with the same form for plural and singular!  Examples:<br />
  aircraft<br />
  sheep<br />
  deer<br />
  cannon<br />
  fish</p>
<p>It, ah, perhaps limits your options a bit, but it certainly resolves the issue!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robwhelan.com/2008/01/25/database-naming-a-response/comment-page-1/#comment-5</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 28 Jan 2008 12:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robwhelan.com/2008/01/25/database-naming-a-response/#comment-5</guid>
		<description>@BlazS: It&#039;s one of those things that I don&#039;t have a strong opinion on -- personally I use singular because it means the table name and object name match exactly, and the PK is [tablename]_id... and I&#039;ve used that approach for years, so it sounds right to me.  I&#039;d rather refer to the customer table than the customers table -- it&#039;s better grammatically.  Also, automating the plural -&gt; singular translation is normally simple, but not always -- unless you pluralize &quot;reply&quot; as &quot;replys&quot;, &quot;person&quot; as &quot;persons&quot;, etc..

On the other hand, another argument for plural (beyond what you mentioned): some databases have administrative tables with names that you perhaps shouldn&#039;t duplicate in your own schema, like &quot;user&quot; and &quot;privilege&quot;.  THOSE are singular (in Oracle at least, which is what I&#039;m thinking of), so if you have a table for your users and your own role/privilege setup in the database, using plural tablenames there&#039;s no possible confusion.

The more important point with this one is consistency, since there&#039;s no significant cost or risk either way -- if I&#039;m working on a database designed by someone else with plural names, I definitely follow that convention with any new tables.</description>
		<content:encoded><![CDATA[<p>@BlazS: It&#8217;s one of those things that I don&#8217;t have a strong opinion on &#8212; personally I use singular because it means the table name and object name match exactly, and the PK is [tablename]_id&#8230; and I&#8217;ve used that approach for years, so it sounds right to me.  I&#8217;d rather refer to the customer table than the customers table &#8212; it&#8217;s better grammatically.  Also, automating the plural -> singular translation is normally simple, but not always &#8212; unless you pluralize &#8220;reply&#8221; as &#8220;replys&#8221;, &#8220;person&#8221; as &#8220;persons&#8221;, etc..</p>
<p>On the other hand, another argument for plural (beyond what you mentioned): some databases have administrative tables with names that you perhaps shouldn&#8217;t duplicate in your own schema, like &#8220;user&#8221; and &#8220;privilege&#8221;.  THOSE are singular (in Oracle at least, which is what I&#8217;m thinking of), so if you have a table for your users and your own role/privilege setup in the database, using plural tablenames there&#8217;s no possible confusion.</p>
<p>The more important point with this one is consistency, since there&#8217;s no significant cost or risk either way &#8212; if I&#8217;m working on a database designed by someone else with plural names, I definitely follow that convention with any new tables.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.402 seconds -->

