<?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: Naming standards? Singular or Plural</title>
	<atom:link href="http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/</link>
	<description>Expert times and information on MySQL</description>
	<lastBuildDate>Fri, 12 Mar 2010 22:45:29 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mau</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-422</link>
		<dc:creator>Mau</dc:creator>
		<pubDate>Thu, 05 Mar 2009 12:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-422</guid>
		<description>Hello,

I really liked the article.

In object oriented language context and supposing that you are going to map every table/entity to a class, would you still propose the same?

   2. Camel Case might be better?
   3. using just &#039;id&#039; everywhere might be appealing.


Any comment on that?

Thank you.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I really liked the article.</p>
<p>In object oriented language context and supposing that you are going to map every table/entity to a class, would you still propose the same?</p>
<p>   2. Camel Case might be better?<br />
   3. using just &#8216;id&#8217; everywhere might be appealing.</p>
<p>Any comment on that?</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Wultsch</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-419</link>
		<dc:creator>Rob Wultsch</dc:creator>
		<pubDate>Fri, 05 Sep 2008 00:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-419</guid>
		<description>Hi Roland,
The L in cNameL is for last name. Also worth note is that dDatetime is actually of the type TIMESTAMP (IIRC).

How awesome is that?</description>
		<content:encoded><![CDATA[<p>Hi Roland,<br />
The L in cNameL is for last name. Also worth note is that dDatetime is actually of the type TIMESTAMP (IIRC).</p>
<p>How awesome is that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-409</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Thu, 04 Sep 2008 13:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-409</guid>
		<description>Hi Rob,

this looks like it was created by a laid off VB programmer that moved on to pursue a career in physical database design.

What&#039;s the L doing in cNameL ?

regards, Roland</description>
		<content:encoded><![CDATA[<p>Hi Rob,</p>
<p>this looks like it was created by a laid off VB programmer that moved on to pursue a career in physical database design.</p>
<p>What&#8217;s the L doing in cNameL ?</p>
<p>regards, Roland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Wultsch</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-418</link>
		<dc:creator>Rob Wultsch</dc:creator>
		<pubDate>Thu, 04 Sep 2008 05:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-418</guid>
		<description>Where is the love for Hungarian notation on column names? #4 is some what similar but would not get you:
cNameL
iAmount
dDatetime

(this lovely notation is enforced where I work, and those columns names are not made up)...</description>
		<content:encoded><![CDATA[<p>Where is the love for Hungarian notation on column names? #4 is some what similar but would not get you:<br />
cNameL<br />
iAmount<br />
dDatetime</p>
<p>(this lovely notation is enforced where I work, and those columns names are not made up)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-417</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Wed, 03 Sep 2008 05:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-417</guid>
		<description>Hi Bill!

(heh. it seems we really do disagree ;) Anyway, it&#039;s fun and interesting to hear your point of view. Comments here to clarify mine - not to bash yours)

&quot;Isn’t this a common enough kind of join that it’d be handy to have some shorthand&quot;

Well, it means in a certain way that you are prepared to say: &quot;of these 2 foreign keys from table A to table B, I think this one here is special enough to give its foreign key column the same name as the pk column of the parent table.&quot;

&quot;it conveys no meaning except for the fact that it’s by convention a primary key&quot;

Yes. But in a way, that is exactly why I like it better than _id. Let me explain. Suppose I see a table called foo, having a name and a description and also the much dreaded id columns. Then I look at it as:

&quot;name in foo, that must be the name of one foo instance, description in foo, that must describe the name of one foo instance, id - darn, that must be the surrogate key that identifies one foo instance&quot;

In your naming scheme, the table would be called &quot;foos&quot; rather than &quot;foo&quot;, and the surrogate primary key would be called &quot;foo_id&quot;. When I look at that I&#039;d say:

&quot;name in foos, that is the name of one foo instance, description: description of one foo instance, foo_id that&#039;s the foo_id of one foo instance - oh no, that must be the name of the id of one foo instance&quot;

So to me, adding &quot;foo&quot; as a prefix is just redundant - to me it&#039;s understood that the foo.id is the id of a foo just like foo.name is the name of a foo.

&quot;I don’t think it’s necessary to prefix all columns, because they’re not nearly as likely to collide. But if every table names its primary key the same thing, they are certain to collide.&quot;

Well, &quot;...not as nearly...&quot; means you&#039;d be needing qualified columns in your queries at least some of the time. I argued in my previous comment that practically, there is not so much difference in prefixing the columns in the table def as compared to qualifying them in the query itself (which is what I prefer). Like I said, it&#039;s almost never the id columns that collide in SELECT lists - I am more interested in the non-id columns there than in the id columns (but it doesn&#039;t matter anyway because I always use qualified columns)

&quot;Nor do I advocate always using the table name as a prefix in the primary key column’s name. &quot;

Well, that would depend on your table naming schema - plural or singular. To me, the plural doesn&#039;t convey any information - its understood the table contains a multiple of &lt;table-name&gt; instances, so all the plural does is lengthen the identifiers. Add in the fact that I can&#039;t easily mechanically derive the plural from the singular, it&#039;s a pretty obvious choice to me - If i have the choice I stick with singular, even if that means living on the edge and defying any ISO standard or Celko book.

&quot;I just helped a user today who had defined a many-to-many table as follows:&quot;

Heh, I recall we discussed this earlier. Actually, this is exactly what I do, and for a reason. In an evolving schema, it&#039;s not uncommon for a many to many relationship to gain attributes of its own, or even at some point to grow children of its own (at which point it apparently was more than just a relationship - apparently it was actually an entity of itself) Rather than adding the surrogate id later on, I do so up front. Having an extra id typically doesn&#039;t hurt in case you really do have a pure intersection table (there may be exceptions if you are dealing with really, really large data sets).

&quot;unfortunately, your syntax is not currently part of the SQL standard nor is it implemented in any SQL parser&quot;

True. The ppl at the standards committee were too busy inventing NATURAL joins too listen to me :p

&quot;it assumes that the storage engine supports named DRI constraints&quot;

Not necessarily. It&#039;s enough for the server to remember all metadata, and use it. It does not actually have to enfore it to look up how to expand this syntax into regular conditions.

regards,

Roland</description>
		<content:encoded><![CDATA[<p>Hi Bill!</p>
<p>(heh. it seems we really do disagree <img src='http://ronaldbradford.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Anyway, it&#8217;s fun and interesting to hear your point of view. Comments here to clarify mine &#8211; not to bash yours)</p>
<p>&#8220;Isn’t this a common enough kind of join that it’d be handy to have some shorthand&#8221;</p>
<p>Well, it means in a certain way that you are prepared to say: &#8220;of these 2 foreign keys from table A to table B, I think this one here is special enough to give its foreign key column the same name as the pk column of the parent table.&#8221;</p>
<p>&#8220;it conveys no meaning except for the fact that it’s by convention a primary key&#8221;</p>
<p>Yes. But in a way, that is exactly why I like it better than _id. Let me explain. Suppose I see a table called foo, having a name and a description and also the much dreaded id columns. Then I look at it as:</p>
<p>&#8220;name in foo, that must be the name of one foo instance, description in foo, that must describe the name of one foo instance, id &#8211; darn, that must be the surrogate key that identifies one foo instance&#8221;</p>
<p>In your naming scheme, the table would be called &#8220;foos&#8221; rather than &#8220;foo&#8221;, and the surrogate primary key would be called &#8220;foo_id&#8221;. When I look at that I&#8217;d say:</p>
<p>&#8220;name in foos, that is the name of one foo instance, description: description of one foo instance, foo_id that&#8217;s the foo_id of one foo instance &#8211; oh no, that must be the name of the id of one foo instance&#8221;</p>
<p>So to me, adding &#8220;foo&#8221; as a prefix is just redundant &#8211; to me it&#8217;s understood that the foo.id is the id of a foo just like foo.name is the name of a foo.</p>
<p>&#8220;I don’t think it’s necessary to prefix all columns, because they’re not nearly as likely to collide. But if every table names its primary key the same thing, they are certain to collide.&#8221;</p>
<p>Well, &#8220;&#8230;not as nearly&#8230;&#8221; means you&#8217;d be needing qualified columns in your queries at least some of the time. I argued in my previous comment that practically, there is not so much difference in prefixing the columns in the table def as compared to qualifying them in the query itself (which is what I prefer). Like I said, it&#8217;s almost never the id columns that collide in SELECT lists &#8211; I am more interested in the non-id columns there than in the id columns (but it doesn&#8217;t matter anyway because I always use qualified columns)</p>
<p>&#8220;Nor do I advocate always using the table name as a prefix in the primary key column’s name. &#8221;</p>
<p>Well, that would depend on your table naming schema &#8211; plural or singular. To me, the plural doesn&#8217;t convey any information &#8211; its understood the table contains a multiple of &lt;table-name&gt; instances, so all the plural does is lengthen the identifiers. Add in the fact that I can&#8217;t easily mechanically derive the plural from the singular, it&#8217;s a pretty obvious choice to me &#8211; If i have the choice I stick with singular, even if that means living on the edge and defying any ISO standard or Celko book.</p>
<p>&#8220;I just helped a user today who had defined a many-to-many table as follows:&#8221;</p>
<p>Heh, I recall we discussed this earlier. Actually, this is exactly what I do, and for a reason. In an evolving schema, it&#8217;s not uncommon for a many to many relationship to gain attributes of its own, or even at some point to grow children of its own (at which point it apparently was more than just a relationship &#8211; apparently it was actually an entity of itself) Rather than adding the surrogate id later on, I do so up front. Having an extra id typically doesn&#8217;t hurt in case you really do have a pure intersection table (there may be exceptions if you are dealing with really, really large data sets).</p>
<p>&#8220;unfortunately, your syntax is not currently part of the SQL standard nor is it implemented in any SQL parser&#8221;</p>
<p>True. The ppl at the standards committee were too busy inventing NATURAL joins too listen to me :p</p>
<p>&#8220;it assumes that the storage engine supports named DRI constraints&#8221;</p>
<p>Not necessarily. It&#8217;s enough for the server to remember all metadata, and use it. It does not actually have to enfore it to look up how to expand this syntax into regular conditions.</p>
<p>regards,</p>
<p>Roland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Karwin</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-416</link>
		<dc:creator>Bill Karwin</dc:creator>
		<pubDate>Wed, 03 Sep 2008 00:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-416</guid>
		<description>Your idea about using constraint names is interesting.  It&#039;s nice that it supports tables that reference a parent table using multiple foreign keys, so the columns are bound to use different names.

But unfortunately, your syntax is not currently part of the SQL standard nor is it implemented in any SQL parser, as far as I know.  And it assumes that the storage engine supports named DRI constraints.</description>
		<content:encoded><![CDATA[<p>Your idea about using constraint names is interesting.  It&#8217;s nice that it supports tables that reference a parent table using multiple foreign keys, so the columns are bound to use different names.</p>
<p>But unfortunately, your syntax is not currently part of the SQL standard nor is it implemented in any SQL parser, as far as I know.  And it assumes that the storage engine supports named DRI constraints.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Karwin</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-415</link>
		<dc:creator>Bill Karwin</dc:creator>
		<pubDate>Wed, 03 Sep 2008 00:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-415</guid>
		<description>Yes, one reason to have descriptive primary key columns is to allow the use of a USING() clause.  This is a concise way to specify join conditions, but you&#039;re right that it only works if the column names are the same in both tables, and you&#039;re doing an equi-join.  Isn&#039;t this a common enough kind of join that it&#039;d be handy to have some shorthand?

You can also omit the column name in a foreign key declaration if the columns have the same name.  It&#039;s no big deal, it&#039;s just a small convenience.

Another reason to eschew the ever-present &quot;id&quot; column is that it conveys no meaning except for the fact that it&#039;s by convention a primary key.  Using a more descriptive column name helps readability.  In cases where the primary key is a natural key instead of a pseudokey, you should name the column to describe its contents.

I don&#039;t think it&#039;s necessary to prefix all columns, because they&#039;re not nearly as likely to collide.  But if every table names its primary key the same thing, they are certain to collide.

Nor do I advocate always using the table name as a prefix in the primary key column&#039;s name.  For one thing, it shouldn&#039;t be plural (e.g. Categories.category_id is preferable to Categories.categories_id).  It also doesn&#039;t need to be based exactly on table name in all cases.

Anyway, all I meant to say is that &quot;id&quot; isn&#039;t a good choice.  Frameworks (like Rails) that insist that every table must have a pseudokey named &quot;id&quot; should be considered harmful!

I just helped a user today who had defined a many-to-many table as follows:

CREATE TABLE (
  id INTEGER AUTO_INCREMENT PRIMARY KEY,
  article_id INTEGER REFERENCES Articles(id),
  keyword_id INTEGER REFERENCES Keywords(id)
);

Ouch!</description>
		<content:encoded><![CDATA[<p>Yes, one reason to have descriptive primary key columns is to allow the use of a USING() clause.  This is a concise way to specify join conditions, but you&#8217;re right that it only works if the column names are the same in both tables, and you&#8217;re doing an equi-join.  Isn&#8217;t this a common enough kind of join that it&#8217;d be handy to have some shorthand?</p>
<p>You can also omit the column name in a foreign key declaration if the columns have the same name.  It&#8217;s no big deal, it&#8217;s just a small convenience.</p>
<p>Another reason to eschew the ever-present &#8220;id&#8221; column is that it conveys no meaning except for the fact that it&#8217;s by convention a primary key.  Using a more descriptive column name helps readability.  In cases where the primary key is a natural key instead of a pseudokey, you should name the column to describe its contents.</p>
<p>I don&#8217;t think it&#8217;s necessary to prefix all columns, because they&#8217;re not nearly as likely to collide.  But if every table names its primary key the same thing, they are certain to collide.</p>
<p>Nor do I advocate always using the table name as a prefix in the primary key column&#8217;s name.  For one thing, it shouldn&#8217;t be plural (e.g. Categories.category_id is preferable to Categories.categories_id).  It also doesn&#8217;t need to be based exactly on table name in all cases.</p>
<p>Anyway, all I meant to say is that &#8220;id&#8221; isn&#8217;t a good choice.  Frameworks (like Rails) that insist that every table must have a pseudokey named &#8220;id&#8221; should be considered harmful!</p>
<p>I just helped a user today who had defined a many-to-many table as follows:</p>
<p>CREATE TABLE (<br />
  id INTEGER AUTO_INCREMENT PRIMARY KEY,<br />
  article_id INTEGER REFERENCES Articles(id),<br />
  keyword_id INTEGER REFERENCES Keywords(id)<br />
);</p>
<p>Ouch!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-413</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Tue, 02 Sep 2008 21:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-413</guid>
		<description>Darn, i had a bunch of &lt;constraint-name&gt; thingies between the parenthesis in my syntax examples, but those get stripped out...

So, I meant:

FROM fk_table PARENT(&lt;fk-constraint-name&gt;) IN pk_table

FROM pk_table CHILDREN(&lt;fk-constraint-name&gt;) IN fk_table

and

GROUP BY KEY(&lt;table-name&gt;)

GROUP BY [UNIQUE &#124; FOREIGN] KEY(&lt;table-name&gt;, &lt;constraint name&gt;)</description>
		<content:encoded><![CDATA[<p>Darn, i had a bunch of &lt;constraint-name&gt; thingies between the parenthesis in my syntax examples, but those get stripped out&#8230;</p>
<p>So, I meant:</p>
<p>FROM fk_table PARENT(&lt;fk-constraint-name&gt;) IN pk_table</p>
<p>FROM pk_table CHILDREN(&lt;fk-constraint-name&gt;) IN fk_table</p>
<p>and</p>
<p>GROUP BY KEY(&lt;table-name&gt;)</p>
<p>GROUP BY [UNIQUE | FOREIGN] KEY(&lt;table-name&gt;, &lt;constraint name&gt;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-412</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Tue, 02 Sep 2008 21:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-412</guid>
		<description>window.status = document.cookie</description>
		<content:encoded><![CDATA[<p>window.status = document.cookie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/naming-standards-singular-or-plural-2008-09-02/comment-page-1/#comment-411</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Tue, 02 Sep 2008 21:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1165#comment-411</guid>
		<description>Hi Bill, Ronald,

&quot;one should not call the primary key in every table “id”&quot;
...
&quot;it also neatly avoids some column name collisions in join queries&quot;

Well, to some extent I agree: by definition, prefixing columns lessens the number of possible collisions. However, for me in practice, collisions don&#039;t pose any problem to me as I always use table aliases and qualified columns anyway. I&#039;m aware you could argue that that&#039;s a chicken-egg situation (&quot;I&#039;m forced to using them, that&#039;s why I use them&quot;), but I think there is another issue at hand here.

Let me put it this way: suppose I would prefix the primary key column with the table name, and make them like %table_name%_id. Now, this will allow me to SELECT primary key columns from several tables, and they won&#039;t collide. However, I usually find I don&#039;t want to select those - meaningless, surrogate - primary key columns. What I do want to select a good deal more often are names, dates, descriptions, and codes.

So I guess my question is, why make such a special case out of primary key columns? If you are determined to prevent these name collisions, shouldn&#039;t you be prefixing *all* columns? For example, all those columns called &quot;name&quot; and &quot;status&quot; and &quot;description&quot; etc. ? It seems to me you should either prefix none of them, or all of them.

And, if you decide to prefix all your columns, is that really practically different from what I do? I prefix all my columns too - I just happen to prefix them with table qualifiers.

I can think of just one reason why you would want to use prefixed primary key columns. If you are fond of the &quot;named columns join&quot; (the one with USING) then it&#039;s convenient to give foreign key columns the same name as their corresponding primary key column. However, this then forces you to write similar joins over distinct foreign keys between the same two tables using different methods: one using the named columns join (for the one foreign key that could be named using the same name as the primary key) and one with the regular explicit qualified join (with ON). I understand that many people like the named columns join despite this, but I really dislike having to solve the exact same problem with two different syntaxes.

The only &#039;fancy&#039; join method that would make sense to me is one that would allow you to somehow use the foreign key constraint name - something like:

FROM fk_table PARENT() IN pk_table

and

FROM pk_table CHILDREN() IN fk_table

that method would work for any imaginable foreign key without the need for special naming schemes, and it would also be resilient to any structural changes to the key.

Once we&#039;d have the possibility to refer to entire constraints, why not allow references to them for other clauses too, like:

GROUP BY KEY()

or

GROUP BY KEY(, )

(PS1: the syntax is not important, the concept of using key names to denote a set of columns is the main thing)

(PS2: not trolling just offering food for thought - this is one of those topics where I don&#039;t wish to pretend there&#039;s one right way)</description>
		<content:encoded><![CDATA[<p>Hi Bill, Ronald,</p>
<p>&#8220;one should not call the primary key in every table “id”&#8221;<br />
&#8230;<br />
&#8220;it also neatly avoids some column name collisions in join queries&#8221;</p>
<p>Well, to some extent I agree: by definition, prefixing columns lessens the number of possible collisions. However, for me in practice, collisions don&#8217;t pose any problem to me as I always use table aliases and qualified columns anyway. I&#8217;m aware you could argue that that&#8217;s a chicken-egg situation (&#8221;I&#8217;m forced to using them, that&#8217;s why I use them&#8221;), but I think there is another issue at hand here.</p>
<p>Let me put it this way: suppose I would prefix the primary key column with the table name, and make them like %table_name%_id. Now, this will allow me to SELECT primary key columns from several tables, and they won&#8217;t collide. However, I usually find I don&#8217;t want to select those &#8211; meaningless, surrogate &#8211; primary key columns. What I do want to select a good deal more often are names, dates, descriptions, and codes.</p>
<p>So I guess my question is, why make such a special case out of primary key columns? If you are determined to prevent these name collisions, shouldn&#8217;t you be prefixing *all* columns? For example, all those columns called &#8220;name&#8221; and &#8220;status&#8221; and &#8220;description&#8221; etc. ? It seems to me you should either prefix none of them, or all of them.</p>
<p>And, if you decide to prefix all your columns, is that really practically different from what I do? I prefix all my columns too &#8211; I just happen to prefix them with table qualifiers.</p>
<p>I can think of just one reason why you would want to use prefixed primary key columns. If you are fond of the &#8220;named columns join&#8221; (the one with USING) then it&#8217;s convenient to give foreign key columns the same name as their corresponding primary key column. However, this then forces you to write similar joins over distinct foreign keys between the same two tables using different methods: one using the named columns join (for the one foreign key that could be named using the same name as the primary key) and one with the regular explicit qualified join (with ON). I understand that many people like the named columns join despite this, but I really dislike having to solve the exact same problem with two different syntaxes.</p>
<p>The only &#8216;fancy&#8217; join method that would make sense to me is one that would allow you to somehow use the foreign key constraint name &#8211; something like:</p>
<p>FROM fk_table PARENT() IN pk_table</p>
<p>and</p>
<p>FROM pk_table CHILDREN() IN fk_table</p>
<p>that method would work for any imaginable foreign key without the need for special naming schemes, and it would also be resilient to any structural changes to the key.</p>
<p>Once we&#8217;d have the possibility to refer to entire constraints, why not allow references to them for other clauses too, like:</p>
<p>GROUP BY KEY()</p>
<p>or</p>
<p>GROUP BY KEY(, )</p>
<p>(PS1: the syntax is not important, the concept of using key names to denote a set of columns is the main thing)</p>
<p>(PS2: not trolling just offering food for thought &#8211; this is one of those topics where I don&#8217;t wish to pretend there&#8217;s one right way)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
