<?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: MySQL&#039;s &quot;enum&quot; datatype is a good thing</title>
	<atom:link href="http://www.databasesandlife.com/mysqls-enum-datatype-is-a-good-thing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.databasesandlife.com/mysqls-enum-datatype-is-a-good-thing/</link>
	<description>Adrian Smith's blog</description>
	<lastBuildDate>Wed, 14 Jul 2010 07:18:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Morris</title>
		<link>http://www.databasesandlife.com/mysqls-enum-datatype-is-a-good-thing/comment-page-1/#comment-1933</link>
		<dc:creator>Peter Morris</dc:creator>
		<pubDate>Mon, 05 Jan 2009 13:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.databasesandlife.com/?p=239#comment-1933</guid>
		<description>Michael C, I think it is you who has missed the point :-)

You use a lookup table if the meaning is purely illustrative for the user.  E.g. moods

Happy, Sad, Angry

but if an application logic needs to function differently depending on the state and the user cannot define the states, as in a purchase order

Raising, Raised, Cancelled

then this should be defined as an enum and not a data table that contains an additional numeric column with a &quot;special value&quot; in it.

Whether the enum belongs in the DB as an enum or not is not my argument, it&#039;s just that your comment about people being too lazy is not accurate.


-- 
Pete
====
http://mrpmorris.blogspot.com
http://www.capableobjects.com - Think domain, not database</description>
		<content:encoded><![CDATA[<p>Michael C, I think it is you who has missed the point :-)</p>
<p>You use a lookup table if the meaning is purely illustrative for the user.  E.g. moods</p>
<p>Happy, Sad, Angry</p>
<p>but if an application logic needs to function differently depending on the state and the user cannot define the states, as in a purchase order</p>
<p>Raising, Raised, Cancelled</p>
<p>then this should be defined as an enum and not a data table that contains an additional numeric column with a &#8220;special value&#8221; in it.</p>
<p>Whether the enum belongs in the DB as an enum or not is not my argument, it&#8217;s just that your comment about people being too lazy is not accurate.</p>
<p>&#8211;<br />
Pete<br />
====<br />
<a href="http://mrpmorris.blogspot.com" rel="nofollow">http://mrpmorris.blogspot.com</a><br />
<a href="http://www.capableobjects.com" rel="nofollow">http://www.capableobjects.com</a> &#8211; Think domain, not database</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael C</title>
		<link>http://www.databasesandlife.com/mysqls-enum-datatype-is-a-good-thing/comment-page-1/#comment-1932</link>
		<dc:creator>Michael C</dc:creator>
		<pubDate>Mon, 05 Jan 2009 13:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.databasesandlife.com/?p=239#comment-1932</guid>
		<description>I think you&#039;ve completely missed the point. The question is not whether enums compared to no enums is a good thing (obviously it&#039;s better to have greater constraint). The real question is whether it&#039;s better to use an enum or a another table to store the list of these enum values. To follow your invoice example above, you would have an invoice table and, say, an InvoiceState table which listed all the possible states of the invoice. You would then have a foreign key joining the 2 tables. The advantage to this is that if you need to add further data to this InvoiceState table then you could (for example, you could have shortname, longname for the enum values etc). Using an enum data type in a database is just a poor substite for those too lazy to create a table.</description>
		<content:encoded><![CDATA[<p>I think you&#8217;ve completely missed the point. The question is not whether enums compared to no enums is a good thing (obviously it&#8217;s better to have greater constraint). The real question is whether it&#8217;s better to use an enum or a another table to store the list of these enum values. To follow your invoice example above, you would have an invoice table and, say, an InvoiceState table which listed all the possible states of the invoice. You would then have a foreign key joining the 2 tables. The advantage to this is that if you need to add further data to this InvoiceState table then you could (for example, you could have shortname, longname for the enum values etc). Using an enum data type in a database is just a poor substite for those too lazy to create a table.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
