<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Database 501</title>
	<atom:link href="http://jeffspost.wordpress.com/2007/07/23/database-501/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeffspost.wordpress.com/2007/07/23/database-501/</link>
	<description>Jeff Staddon on Business and Technology</description>
	<lastBuildDate>Sun, 12 Jul 2009 17:41:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jeffspost</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-74</link>
		<dc:creator>jeffspost</dc:creator>
		<pubDate>Wed, 22 Aug 2007 02:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-74</guid>
		<description>Thanks for the correction.  Caught me working from memory instead of checking my facts!  I&#039;ve corrected the post.  I guess my school (http://computing.southern.edu/) is unusual in offering (in fact requiring) a very solid database class as part of the CS major.  Unfortunately, most students (including me) don&#039;t really realize the gold mine of info a class like that provides. . .  hopefully some of you younger ones out there reading this will benifit from the experience of us &quot;old&quot; (is early 30&#039;s old?) folks!</description>
		<content:encoded><![CDATA[<p>Thanks for the correction.  Caught me working from memory instead of checking my facts!  I&#8217;ve corrected the post.  I guess my school (<a href="http://computing.southern.edu/" rel="nofollow">http://computing.southern.edu/</a>) is unusual in offering (in fact requiring) a very solid database class as part of the CS major.  Unfortunately, most students (including me) don&#8217;t really realize the gold mine of info a class like that provides. . .  hopefully some of you younger ones out there reading this will benifit from the experience of us &#8220;old&#8221; (is early 30&#8217;s old?) folks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chet</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-66</link>
		<dc:creator>chet</dc:creator>
		<pubDate>Tue, 21 Aug 2007 05:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-66</guid>
		<description>Jeff,

Just to be clear, the limit on object names in Oracle is 30 characters, not 32 as mentioned in a couple of different places (someone else made the point but didn&#039;t specifically refute the original assertion).

I think we are on the same page on most of your points though we would probably have minor disagreements on specifics. ;)

As to schooling, I have found the same, most schools that I have investigated don&#039;t have a very comprehensive database side of things until you get into the graduate level courses.  Just about every job out there is data driven and for those that do pure programming, there is still some level of persistent data (usually in the form of config files or something).

chet</description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>Just to be clear, the limit on object names in Oracle is 30 characters, not 32 as mentioned in a couple of different places (someone else made the point but didn&#8217;t specifically refute the original assertion).</p>
<p>I think we are on the same page on most of your points though we would probably have minor disagreements on specifics. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>As to schooling, I have found the same, most schools that I have investigated don&#8217;t have a very comprehensive database side of things until you get into the graduate level courses.  Just about every job out there is data driven and for those that do pure programming, there is still some level of persistent data (usually in the form of config files or something).</p>
<p>chet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-40</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 16 Aug 2007 09:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-40</guid>
		<description>PL-it

You misunderstand. The alias is not used as the table name but as a standard identifier for field names used as foreign keys. In the ideal world we would use full table names for fields but ORACLE impose a 30 char limit and so the alias approach is the way to go.

It does not increase the learning curve and makes the FK fields stand out when you look at a field list as they are of the form PKG_PRD_ID.

In fact a list of alias and table names is available so it makes reference very easy and we also have copious model diagrams and an excellent modelling tool.

Well each to their own I guess but when you go from 10 table DB&#039;s to 261 at the last count you start to appreciate how those initial standards pay off.</description>
		<content:encoded><![CDATA[<p>PL-it</p>
<p>You misunderstand. The alias is not used as the table name but as a standard identifier for field names used as foreign keys. In the ideal world we would use full table names for fields but ORACLE impose a 30 char limit and so the alias approach is the way to go.</p>
<p>It does not increase the learning curve and makes the FK fields stand out when you look at a field list as they are of the form PKG_PRD_ID.</p>
<p>In fact a list of alias and table names is available so it makes reference very easy and we also have copious model diagrams and an excellent modelling tool.</p>
<p>Well each to their own I guess but when you go from 10 table DB&#8217;s to 261 at the last count you start to appreciate how those initial standards pay off.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PL-it</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-20</link>
		<dc:creator>PL-it</dc:creator>
		<pubDate>Sun, 12 Aug 2007 04:58:19 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-20</guid>
		<description>This should be database 101. I agree with much said, however, please don&#039;t do things like ...

PACKAGE_PRODUCTS - PKG_PRD
BOOKING_PACKAGES - BKG_PKG

I&#039;d like to point out two issues with the above. 1) This is not intuitive for newer people working on your db. You are adding in an unnecessary learning curve, which, despite a persons skills, can present a considerable road block to &quot;getting things done&quot;. How much more difficult is it to type out 6 more characters, in each object name? 2) Please avoid UPPER CASE object names. Not only does it tend to make reading complex queries or scanning a high number of db objects more difficult, it also can cause confusion in case sensitive db&#039;s (e.g. Postgres). Rather, I advocate creating db objects in all lower case, while allowing mixed case of those object names within queries. The advantages you&#039;ll have are: easy readability of objects in queries, easy portability/usage in case sensitive db&#039;s, and scanning db objects in a visual db tool won&#039;t be nearly as difficult as it would be if all objects were UPPER CASE.</description>
		<content:encoded><![CDATA[<p>This should be database 101. I agree with much said, however, please don&#8217;t do things like &#8230;</p>
<p>PACKAGE_PRODUCTS &#8211; PKG_PRD<br />
BOOKING_PACKAGES &#8211; BKG_PKG</p>
<p>I&#8217;d like to point out two issues with the above. 1) This is not intuitive for newer people working on your db. You are adding in an unnecessary learning curve, which, despite a persons skills, can present a considerable road block to &#8220;getting things done&#8221;. How much more difficult is it to type out 6 more characters, in each object name? 2) Please avoid UPPER CASE object names. Not only does it tend to make reading complex queries or scanning a high number of db objects more difficult, it also can cause confusion in case sensitive db&#8217;s (e.g. Postgres). Rather, I advocate creating db objects in all lower case, while allowing mixed case of those object names within queries. The advantages you&#8217;ll have are: easy readability of objects in queries, easy portability/usage in case sensitive db&#8217;s, and scanning db objects in a visual db tool won&#8217;t be nearly as difficult as it would be if all objects were UPPER CASE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: D Conlon</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-10</link>
		<dc:creator>D Conlon</dc:creator>
		<pubDate>Mon, 06 Aug 2007 22:47:31 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-10</guid>
		<description>Another tip: Know when *not* to use a database. Recently I wrote a system to report on global revenue across a handful of multi-level &quot;regions&quot;. Needless to say these regions were arbitrary and would be subject to change.

Sounds like they need to be coerced into a hierarchical DB structure right? Well, that&#039;s what I did, until a few months later when my colleague realised that no one was changing this info, and it was really just adding unnecessary complexity and latency.

We moved the hierarchy into the code itself, where it&#039;s better-documented, checked into source control, and much faster.</description>
		<content:encoded><![CDATA[<p>Another tip: Know when *not* to use a database. Recently I wrote a system to report on global revenue across a handful of multi-level &#8220;regions&#8221;. Needless to say these regions were arbitrary and would be subject to change.</p>
<p>Sounds like they need to be coerced into a hierarchical DB structure right? Well, that&#8217;s what I did, until a few months later when my colleague realised that no one was changing this info, and it was really just adding unnecessary complexity and latency.</p>
<p>We moved the hierarchy into the code itself, where it&#8217;s better-documented, checked into source control, and much faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobby</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-9</link>
		<dc:creator>Bobby</dc:creator>
		<pubDate>Sun, 05 Aug 2007 00:57:29 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-9</guid>
		<description>wls

Also, the problem is, you have to write a program/procedure outside the database language to extract useful information from the comma separated list items (the list items could separated in other ways). Say you were recording sales of pies, your non normalized table might be:

Day Sales
Mon Apple 2, Blackberry 2, Cherry 3
Tue Blackberry 2, Apple 2, Cherry 3
Wed Apple 1, Blackberry 2, Apple 1, Cherry 3

The sales for each day are the same, but you can not easily tell. How would you count Apple sales each day or in total? (Partial) Normalizing might give:

Day Product Qty
Mon Apple 2
Mon Blackberry 2
Mon Cherry 3
Tue Apple 2
Tue Blackberry 2
Tue Cherry 3
Wed Apple 2
Wed Blackberry 2
Wed Cherry 3

Using something like:
SELECT Product, COUNT(Qty) AS TotalQty
 FROM DailyProductSales
 GROUP BY Product ;

Giving:

Product TotalQty
Apple 6
Blackberry 6
Cherry 9</description>
		<content:encoded><![CDATA[<p>wls</p>
<p>Also, the problem is, you have to write a program/procedure outside the database language to extract useful information from the comma separated list items (the list items could separated in other ways). Say you were recording sales of pies, your non normalized table might be:</p>
<p>Day Sales<br />
Mon Apple 2, Blackberry 2, Cherry 3<br />
Tue Blackberry 2, Apple 2, Cherry 3<br />
Wed Apple 1, Blackberry 2, Apple 1, Cherry 3</p>
<p>The sales for each day are the same, but you can not easily tell. How would you count Apple sales each day or in total? (Partial) Normalizing might give:</p>
<p>Day Product Qty<br />
Mon Apple 2<br />
Mon Blackberry 2<br />
Mon Cherry 3<br />
Tue Apple 2<br />
Tue Blackberry 2<br />
Tue Cherry 3<br />
Wed Apple 2<br />
Wed Blackberry 2<br />
Wed Cherry 3</p>
<p>Using something like:<br />
SELECT Product, COUNT(Qty) AS TotalQty<br />
 FROM DailyProductSales<br />
 GROUP BY Product ;</p>
<p>Giving:</p>
<p>Product TotalQty<br />
Apple 6<br />
Blackberry 6<br />
Cherry 9</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Wood</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-8</link>
		<dc:creator>Andrew Wood</dc:creator>
		<pubDate>Fri, 27 Jul 2007 15:41:29 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-8</guid>
		<description>wls

If the data is a string that happens to have commas then it is ok. It is when the field is being used to represent a sequence of values that would otherwise occupy a seperate table that is foreign keyed to the table in which you have put the csv values in.

Example

Table of screen sizes and screen types (field:value)

Type:Plasma size:32,37,42,50,60 resolution 766x355,766x512...
Type:LCD size 28,32,37,40,42,47,50 Resolution 1024x768,1280,960...

Should be a table for screen type

ID Type
1   Plasma
2   LCD

and a table for size

ID SCREEN Size Resolution
1   1           32   766x355
2   1           37   766x512
3   1           42   ..
..
..
n   2           28  1024x768</description>
		<content:encoded><![CDATA[<p>wls</p>
<p>If the data is a string that happens to have commas then it is ok. It is when the field is being used to represent a sequence of values that would otherwise occupy a seperate table that is foreign keyed to the table in which you have put the csv values in.</p>
<p>Example</p>
<p>Table of screen sizes and screen types (field:value)</p>
<p>Type:Plasma size:32,37,42,50,60 resolution 766&#215;355,766&#215;512&#8230;<br />
Type:LCD size 28,32,37,40,42,47,50 Resolution 1024&#215;768,1280,960&#8230;</p>
<p>Should be a table for screen type</p>
<p>ID Type<br />
1   Plasma<br />
2   LCD</p>
<p>and a table for size</p>
<p>ID SCREEN Size Resolution<br />
1   1           32   766&#215;355<br />
2   1           37   766&#215;512<br />
3   1           42   ..<br />
..<br />
..<br />
n   2           28  1024&#215;768</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wls</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-7</link>
		<dc:creator>wls</dc:creator>
		<pubDate>Fri, 27 Jul 2007 06:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-7</guid>
		<description>why is it not good to save comma separated values inside database fields?</description>
		<content:encoded><![CDATA[<p>why is it not good to save comma separated values inside database fields?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Wood</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-6</link>
		<dc:creator>Andrew Wood</dc:creator>
		<pubDate>Tue, 24 Jul 2007 14:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-6</guid>
		<description>Hi

Like the list a lot. Kind of putting it into words for how we do it here.

As part of the DB design we describe tables (within 30 chars) as best we can and also create an alias to the table (this is just a recorded alias in the modelling tool). We then use this alias for all foreign key references.

Example

  BOOKINGS - BKG
  BOOKING_ITEMS - BIT
  
So in BOOKING_ITEMS we have a FK to bookings BKG_ID. If you follow this approach you then get very readable SQL

..
from
  bookings bkg,
  booking_items bit
where
  bit.bkg_id = bkg.id
..

You also keep the foreign key names short which allows the 30 char limit not to be exceeded. The alias is either 3 chars or 7 (2 lots of 3 with an _ between)

  PACKAGE_PRODUCTS - PKG_PRD
  BOOKING_PACKAGES - BKG_PKG

etc.

You can extend it to FK naming so

  BOOKING_ITEMS.BKG_ID would have a FK name of BIT_BKG_FK

any indexes for the FK have an I appended i.e. BIT_BKG_FK_I

The project I am on at the momment has around 250 tables and this approach gets more sensible the larger number of tables.

I agree with ORACLE name lengths it must be a real issue for them not to change it. A company that has produced what they have done surely would have made that change long ago if they could. From the outside you imagine it is like falling off a log.</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Like the list a lot. Kind of putting it into words for how we do it here.</p>
<p>As part of the DB design we describe tables (within 30 chars) as best we can and also create an alias to the table (this is just a recorded alias in the modelling tool). We then use this alias for all foreign key references.</p>
<p>Example</p>
<p>  BOOKINGS &#8211; BKG<br />
  BOOKING_ITEMS &#8211; BIT</p>
<p>So in BOOKING_ITEMS we have a FK to bookings BKG_ID. If you follow this approach you then get very readable SQL</p>
<p>..<br />
from<br />
  bookings bkg,<br />
  booking_items bit<br />
where<br />
  bit.bkg_id = bkg.id<br />
..</p>
<p>You also keep the foreign key names short which allows the 30 char limit not to be exceeded. The alias is either 3 chars or 7 (2 lots of 3 with an _ between)</p>
<p>  PACKAGE_PRODUCTS &#8211; PKG_PRD<br />
  BOOKING_PACKAGES &#8211; BKG_PKG</p>
<p>etc.</p>
<p>You can extend it to FK naming so</p>
<p>  BOOKING_ITEMS.BKG_ID would have a FK name of BIT_BKG_FK</p>
<p>any indexes for the FK have an I appended i.e. BIT_BKG_FK_I</p>
<p>The project I am on at the momment has around 250 tables and this approach gets more sensible the larger number of tables.</p>
<p>I agree with ORACLE name lengths it must be a real issue for them not to change it. A company that has produced what they have done surely would have made that change long ago if they could. From the outside you imagine it is like falling off a log.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonas</title>
		<link>http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-5</link>
		<dc:creator>Jonas</dc:creator>
		<pubDate>Tue, 24 Jul 2007 07:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://jeffspost.wordpress.com/2007/07/23/database-501/#comment-5</guid>
		<description>I&#039;m all with you on that single item wish list for Oracle, but we can&#039;t ignore reality. If I&#039;m to expect change then a move to Oracle is never far off (been there, done that) so naming should (I really do hate myself for having to say this) be restricted to 32 characters. The real pain is indexes as one tends to make them up using table AND column names ...

One solution, the one I&#039;m using currently, is to have an alias feature &quot;in between&quot; where truncated table names, or renamed to whatever, in the database is only a configuration issue (code still uses &quot;full&quot; names). I&#039;d drop that in an instance though, if Oracle just entered the modern age.</description>
		<content:encoded><![CDATA[<p>I&#8217;m all with you on that single item wish list for Oracle, but we can&#8217;t ignore reality. If I&#8217;m to expect change then a move to Oracle is never far off (been there, done that) so naming should (I really do hate myself for having to say this) be restricted to 32 characters. The real pain is indexes as one tends to make them up using table AND column names &#8230;</p>
<p>One solution, the one I&#8217;m using currently, is to have an alias feature &#8220;in between&#8221; where truncated table names, or renamed to whatever, in the database is only a configuration issue (code still uses &#8220;full&#8221; names). I&#8217;d drop that in an instance though, if Oracle just entered the modern age.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
