<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shane&#039;s blog &#187; Database Design Concepts</title>
	<atom:link href="http://blog.shamess.info/category/university/database-design-concepts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shamess.info</link>
	<description>Personal blog of Shane Preece. Occaisional politics and tech minddump.</description>
	<lastBuildDate>Wed, 18 Jan 2012 10:28:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pseudo-FAT in a database</title>
		<link>http://blog.shamess.info/2009/03/28/pseudo-fat-in-a-database/</link>
		<comments>http://blog.shamess.info/2009/03/28/pseudo-fat-in-a-database/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 01:55:35 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Database Design Concepts]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[concept]]></category>
		<category><![CDATA[er model]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=575</guid>
		<description><![CDATA[I&#8217;m creating a pseudo-file system for my game, using a MySQL database as the FAT. I thought it would be fairly simple at first, but as I was about to program it, I realised that my method I planned on &#8230; <a href="http://blog.shamess.info/2009/03/28/pseudo-fat-in-a-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m creating a pseudo-file system for my game, using a MySQL database as the FAT. I thought it would be fairly simple at first, but as I was about to program it, I realised that my method I planned on using is hugely expensive. Since it&#8217;s a call that&#8217;ll be used hundreds of times each time the player plays for a short period I really can&#8217;t do with it being a resource intensive feature.</p>
<div id="attachment_576" class="wp-caption alignright" style="width: 272px"><a href="http://blog.shamess.info/wp-content/uploads/2009/03/er-model-directories.png"><img class="size-full wp-image-576" title="er-model-directories" src="http://blog.shamess.info/wp-content/uploads/2009/03/er-model-directories.png" alt="ER model of directory table" width="262" height="172" /></a><p class="wp-caption-text">ER model of directory table (I&#39;ll change this to a prettier one when I have the energy and time to play around in GIMP)</p></div>
<p>Basically, it&#8217;s just navigating directories. Here&#8217;s how they&#8217;re stored in the database, according to the ER model to the right:</p>
<p>harddrive_directories (<strong>directoryID<em>, </em></strong>directoryName, parent)</p>
<p>The foreign key inside the same table with the primary key through me for a second, but I understand that now.</p>
<p>My problem is when a user gives me a string like &#8220;/foo/bar/alien/&#8221;, and I then have to find the ID for the directory labeled &#8220;alien&#8221;. I obviously can&#8217;t just search for directories called &#8220;alien&#8221; because there could be a &#8220;/foo/alien/&#8221; or any other combination. (Though to cut out any needless directory traversing, it would be faster to do that; see if there are any directories called &#8220;alien&#8221;, if there&#8217;s only one work <em>backwards</em>, which is much easier to check if it&#8217;s what I&#8217;m looking for, if there&#8217;s more than one, we don&#8217;t have much choice.)</p>
<p>So, I look for a root directory called &#8220;foo&#8221;. There can only be one, so that&#8217;s fairly simple. Now I have foo&#8217;s ID, I can look up all of the directories called &#8220;bar&#8221; whose parent is fooID. And so on, untill I get to a directory called &#8220;alien&#8221;.</p>
<p>Now I&#8217;ve said it outloud, there&#8217;s really only <em>n</em> lookups (where <em>n</em> is the number of directories in the path), which isn&#8217;t so bad. Is there a better way of doing this though?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/03/28/pseudo-fat-in-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s not redundant, just plain stupid.</title>
		<link>http://blog.shamess.info/2009/02/09/not-redundant-just-stupid/</link>
		<comments>http://blog.shamess.info/2009/02/09/not-redundant-just-stupid/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 13:34:05 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Database Design Concepts]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=397</guid>
		<description><![CDATA[I just decided to pop in here to have a tiny rant about something that&#8217;s bugging me about my Database Design class. I just got my assignment. We&#8217;re basically to design and set up a database, create forms, use VBA, &#8230; <a href="http://blog.shamess.info/2009/02/09/not-redundant-just-stupid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just decided to pop in here to have a tiny rant about something that&#8217;s bugging me about my Database Design class.</p>
<p>I just got my assignment. We&#8217;re basically to design and set up a database, create forms, use VBA, general piss easy stuff. I&#8217;m a little annoyed to read the specification for this work to find that we&#8217;ve actually been told most of the table names, and attributes that need to be there. Thanks for taking away my creativity.</p>
<p>What I&#8217;m most annoyed though is this:</p>
<blockquote><p>Finally &#8216;status&#8217; is set to &#8216;current&#8217; and &#8216;end date&#8217; is left null. When a customer wishes to end a contract the end date is set for the last day of the current month and the status is changed to <em>&#8216;ended&#8217;</em>.</p></blockquote>
<p>It&#8217;s not just me that finds this stupid, right? I can&#8217;t even really explain why this annoys me.</p>
<p>Company&#8217;s don&#8217;t do this. They have minimum term contracts. They&#8217;d just have a StartDate (when the customer wants the contract to start) and and EndDate (when it&#8217;s to end). In fact, a better design would be ContractLength.</p>
<p>Leaving the empty EndDate seems dumb to me. And having to have some sort of batch process which checks for an EndDate and then updates Status seems like a lot of extra work. Why does Status even sodding exist? In that stupid system, if there&#8217;s no EndDate then it&#8217;s obviously &#8220;current&#8221;, else &#8220;ended&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/02/09/not-redundant-just-stupid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stupid course is stupid.</title>
		<link>http://blog.shamess.info/2009/02/07/stupid-course-is-stupid/</link>
		<comments>http://blog.shamess.info/2009/02/07/stupid-course-is-stupid/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 16:23:47 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[Database Design Concepts]]></category>
		<category><![CDATA[Systems Analysis]]></category>
		<category><![CDATA[assignments]]></category>
		<category><![CDATA[laura krumfort]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=381</guid>
		<description><![CDATA[I&#8217;m actually feeling productive today, and I&#8217;m fairly certain I have a multitude of work to do. I woke up with the intent of creating this database we need for Database Design Concepts. Well, I say need, but it turns &#8230; <a href="http://blog.shamess.info/2009/02/07/stupid-course-is-stupid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m actually feeling productive today, and I&#8217;m fairly certain I have a multitude of work to do.</p>
<p>I woke up with the intent of creating this database we need for Database Design Concepts. Well, I say <em>need</em>, but it turns out we might not actually have to hand it in. Because I thought it was integral to my learning, I sat through it and slowly knocked up a few tables following the instructions letter by letter.</p>
<p>When it started explaining, in great detail, how to change the freaking font of a label I gave in. Not only was it offending me, but flicking through the book I can&#8217;t see anywhere where it&#8217;s telling me to hand the finished database in. Even if it did, what would be the point?  You can&#8217;t vary from the obnoxious instructions; even if one person created the database and then gave a copy to everyone in the class the person marking it would never know. They&#8217;re all <em>identical.</em></p>
<p>So, I gave in with that. I&#8217;m pretty sure there&#8217;s more work to be done, so I asked Laura. Apparently we have a Systems Analysis assignment that we&#8217;ve not been told about yet.</p>
<p>The final assignment we have is from Computer Tech, to create a website. I&#8217;m not sure why I can&#8217;t just give him the URL to one of the many websites I&#8217;ve designed and coded to prove my work, but meh. I have to create a guide about Leicester for freshers of DMU, which I&#8217;m okay with actually. I might even be able to make some money from it. Even if I do feel slightly underestimated.</p>
<p>Why can&#8217;t university be as hard as I actually expected? Why do people walk into a degree with zero knowledge of the course? There are people that have blatantly never even used a computer before on my course; wtf? Just make A Level Computing a requirement of the course entry, and teach with that as a foundation. Don&#8217;t freaking teach it me again! Grr.</p>
<p>I&#8217;d switch to Computer Science if I wasn&#8217;t so worried my math would let me down.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/02/07/stupid-course-is-stupid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class summary for today</title>
		<link>http://blog.shamess.info/2009/01/19/class-summary-for-today/</link>
		<comments>http://blog.shamess.info/2009/01/19/class-summary-for-today/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 16:57:56 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[Database Design Concepts]]></category>
		<category><![CDATA[Visual Web Development]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=365</guid>
		<description><![CDATA[In visual web dev. we just learnt about parameters for functions, and making subroutines and functions. Yeah, it was thrilling. I finished up the set work in the first hour (class is two hours along) and just spent the rest &#8230; <a href="http://blog.shamess.info/2009/01/19/class-summary-for-today/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In visual web dev. we just learnt about parameters for functions, and making subroutines and functions. Yeah, it was thrilling. I finished up the set work in the first hour (class is two hours along) and just spent the rest playing with Flash.</p>
<p>Database design concepts was okay. &#8220;Okay&#8221; is measured by &#8220;did I learn something?&#8221; and I sort of did. It was about how DBMSs should handle their integrity, using rollbacks and transactions. Also on user privileges.</p>
<p>When I can be more motivated (or if someone asks), I&#8217;ll come back and actually explain what they mean, because a few people missed that lecture. For now though, I&#8217;m going to work on my Leicester Guide Website for my computer technology assignment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/01/19/class-summary-for-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weeks one and two summary: Database Design Concepts</title>
		<link>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-database-design-concepts/</link>
		<comments>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-database-design-concepts/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 19:12:16 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Database Design Concepts]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[dmu]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[University]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=145</guid>
		<description><![CDATA[We started with a lecture in this class, which was good since most people probably had no idea why a database was interesting, and why they shouldn&#8217;t be using a spreadsheet. To be perfectly honest though, I&#8217;m sure a lot &#8230; <a href="http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-database-design-concepts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We started with a lecture in this class, which was good since most people probably had no idea why a database was interesting, and why they shouldn&#8217;t be using a spreadsheet. To be perfectly honest though, I&#8217;m sure a lot of people still don&#8217;t know. Though, thinking about it, most people seemed to understand some of the SQL so maybe I&#8217;m just under estimating them.</p>
<p>Reasons why you shouldn&#8217;t use a spreadsheet to <em>store</em> data:</p>
<ul>
<li>It&#8217;s too easy to repeat data. For instance in a database you could just say &#8220;this row belongs to user 85&#8243;, and then have one row describing user 85, like their name and such. However, in a spreadsheet, unless you wanted to look up user 85 every time they were mentioned, you&#8217;d have to write out their name potentially hundreds of times. And then what if they change their name? You&#8217;ll have to go through and at least write  a macro to rewrite all the names, where in a table you&#8217;d just need to change the user table once.</li>
<li>Spreadsheets take up a lot of space, due to the repeat data, and also due to most the cells being in the wrong, or bad, format so compression is harder. For instance, in a database we could just say that a telephone number is capped at eleven characters. The file system now only needs to give that field that many bytes of data. Whereas in a spreadsheet it&#8217;d have to be variable length, a much greater resource intensive method.</li>
<li>They&#8217;re not as accessible. Over a network the user would need to download the spreadsheet then make any amendments they want, and then uploading it. They&#8217;d also need to lock the file so no one else could even read the data whilst it was in use. With a database, it&#8217;d stay on a central server where anyone can access the data at the same time. The database server could better manage user collisions.</li>
<li>Sticking with that example, a spreadsheet would require tenfold more bandwidth.</li>
</ul>
<p>That&#8217;s enough examples.</p>
<p>After that we just jumped into learning terminology. That&#8217;ll probably the hardest thing for me to learn. Since I&#8217;m mostly self-taught I&#8217;ve rarely had to refer to much to anyone other than myself. For instance, my tutor refers to fields as &#8220;attributes&#8221;, which is what I could have called it&#8217;s type (she calls that the &#8220;attribute type&#8221;).</p>
<p>As she explained the term &#8220;key field&#8221; I got a little annoyed. I think she made it sound as though primary keys and unique keys were interchangeable words for the same thing, which they&#8217;re just not. <strong>Primary</strong> keys tell the database that it&#8217;s a unique field which is safe to refer to the row as. Whilst that&#8217;s the same for a unique field, <strong>unique</strong> keys aren&#8217;t usually used as foreign keys.</p>
<p>During the tutorial we had an example database, which a few tables. As a class (which is good, since most people were new at it, they might be unsure about what exactly the should be doing) we answered a few questions where we had to decide which tables we needed to select to get the information we wanted. Like, &#8220;list the students first names&#8221;. That was simple enough, so the WHERE clause was introduced. &#8220;List the first names of the students who were studying computing&#8221;.</p>
<p>As we were working through the lab workbook, I was pretty happy that people sitting close to me felt comfortable enough to ask me if they were stuck. The main problem I think for most people was that they didn&#8217;t understand that you need to tell the computer exactly what you want. When the problem asked to return all the students&#8217; addresses, two people that asked me for help got it wrong because they had tried to called the table name `address` when they needed `street` and `town`. I&#8217;m pretty sure that&#8217;s just a thing they&#8217;ll get used to though.</p>
<p>In this class we&#8217;re going to be assessed on our ability to write SQL statements, I think. At least at the moment. I&#8217;m not sure how advanced we&#8217;re going to go into it though. So far it&#8217;s just SELECT we&#8217;re using, with WHERE, OR/AND, and comparison statements on single tables. Look through the lab work book, I saw that later we&#8217;ll be joining tables too. I think I saw a COUNT in there too, so I hope we&#8217;ll be using more complex SQL functions. I&#8217;ve never had much need to use them before.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-database-design-concepts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

