<?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>fuzzymargins &#187; Data Modelling</title>
	<atom:link href="http://www.fuzzymargins.com/category/data-modelling/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fuzzymargins.com</link>
	<description>Life is full of code</description>
	<lastBuildDate>Sun, 07 Mar 2010 14:21:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Many to Many Relationships</title>
		<link>http://www.fuzzymargins.com/2008/12/many-to-many-relationships/</link>
		<comments>http://www.fuzzymargins.com/2008/12/many-to-many-relationships/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 17:54:31 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Data Modelling]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=31</guid>
		<description><![CDATA[Data Modelling relationships between tables The thing that got me writing this article was a question posted on Stack Overflow about data design, asking whether it&#8217;s better to use one big table or to arrange the data using multiple related tables.  Having spent many years working with relational databases this seems obvious, it&#8217;s easy to [...]]]></description>
			<content:encoded><![CDATA[<h3>Data Modelling relationships between tables</h3>
<p>The thing that got me writing this article was a question posted on <a href="http://stackoverflow.com/">Stack Overflow</a> about data design, asking whether it&#8217;s better to use one big table or to arrange the data using multiple related tables.  Having spent many years working with relational databases this seems obvious, it&#8217;s easy to forget this is not common knowledge and assume everyone knows this stuff.</p>
<p><span id="more-31"></span></p>
<p>The examples below are from a database that contains information about <a title="Oxford Portraits" href="http://www.odl.ox.ac.uk/oxfordportraits" target="_blank">portraits belonging to the University of Oxford</a>.  These portraits are referred to as Works in the database.</p>
<p>The database also holds details of the  people connected to the portraits. This includes the subject of the portrait (the sitter),  the artists who produced the portrait, and others such as donors who have bequeathed portraits to the university.</p>
<p>A portrait may be connected to many people and a person may be connected to many portraits, in other words a many-to-many relationship exists between portraits and people.</p>
<p>There are various ways in which this can be modelled:</p>
<ul>
<li>Store the portraits and people in a single table. When several people are linked to a portrait can either have multiple sets of columns to hold the extra people or have multiple rows where the portrait data is repeated</li>
<li>Store the portraits and people in two separate tables with columns in the portrait tables that hold the links to the various people</li>
<li>Store the portraits and people in separate tables with a third table to hold the relationships</li>
</ul>
<p>The problem with the first two solutions above is that data is either repeated or is left empty in case it is required as we can&#8217;t know up front how many relationships there will be for each portrait and person.  They are also hard to change when new requirements are identified, e.g. a new type of person needs to be added.</p>
<p>The third solution doesn&#8217;t require repeating (redundant) data or booking spaces for relationships that may or may not be required, using data modelling terms we can say it has been <em>normalised</em>.</p>
<p>The extra table by convention is named from concatenating the names of the two tables in the many-to-many relationship, hence the new table in our example is called Work_People as it links the Work and People tables.</p>
<p><img class="alignnone size-medium wp-image-154" title="People and Work Entity Relationship diagram" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/people_work.gif" alt="People and Work Entity Relationship diagram" width="500" height="198" /></p>
<p>The new table is constructed by taking the Primary Key of each of the parent tables. These become the primary key of the new table. In our example both tables have numeric primary keys that are incremented for each new row. Using these abstract keys allows the data in the tables to be changed without having to update the relationships, e.g. the names in the People table can be changed without having to update the Work_People or Work tables.</p>
<p class="note">Note the relationships in the diagram between the three tables.  The connectors that link the tables have a single terminator at the <em>One </em>end of the relationship and have a crows foot at the <em>Many </em>end of the relationship.</p>
<p><img class="alignleft size-full wp-image-142" title="vp_relationship_one2" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_relationship_one2.png" alt="vp_relationship_one2" width="227" height="137" />There is a One at the<em> One </em>end of the relationship</p>
<p>There is a Zero at the <em>Many </em>end of the relationship.</p>
<p>This is the cardinality of the relationship which means the connector between the Work and Work_People tables can be read as <em>Exactly One </em>row in the Work table can be related to <em>Zero or More</em> Work_People rows.</p>
<p>In other words, new rows can be added to the Work and People tables without having to add relationships to the Work_People table. This allows new works and new people to be added independently of each other,  then the relationships are added as and when required. Note that this isn&#8217;t always the case, cardinality will vary and in some cases may specify that the relationships must be added at the same time as the rows in the main tables.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2008/12/many-to-many-relationships/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the free edition of Visual Paradigm</title>
		<link>http://www.fuzzymargins.com/2008/12/installing-the-free-edition-of-visual-paradigm/</link>
		<comments>http://www.fuzzymargins.com/2008/12/installing-the-free-edition-of-visual-paradigm/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 17:52:32 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Data Modelling]]></category>
		<category><![CDATA[Software tools]]></category>
		<category><![CDATA[ERD]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=63</guid>
		<description><![CDATA[How to install Visual Paradigm community edition While writing an article on implementing Many to Many Relationships in databases the need for a diagramming tool became clear.  At  work Visual Paradigm is the tool for all UML and data modelling requirements, so it was good to read there is a free community edition that can [...]]]></description>
			<content:encoded><![CDATA[<h3>How to install Visual Paradigm community edition</h3>
<p><img class="size-medium wp-image-71 alignright" title="vp_download_ce" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_download_ce-300x169.png" alt="vp_download_ce" width="300" height="169" />While writing an article on implementing Many to Many Relationships in databases the need for a diagramming tool became clear.  At  work Visual Paradigm is the tool for all UML and data modelling requirements, so it was good to read there is a free <a href="http://www.visual-paradigm.com/product/vpuml/communityedition.jsp">community edition</a> that can be downloaded for personal use. The Community Edition page has a link on the left hand-side to download Visual Paradigm.</p>
<p><span id="more-63"></span></p>
<p><img class="size-medium wp-image-73 alignleft" title="vp_download_page" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_download_page-300x171.png" alt="vp_download_page" width="300" height="171" /></p>
<p>Clicking  on the round image highlighted in yellow will prompt for registration or a user name and password.  Once you have registered the next page has two checkboxes,  select the second check box to request a license key as an attachment, this will be sent as an email to the address provided during registration.</p>
<p>Then click on the Download button to start downloading the large (140 Mb) executable file.  Once it has been downloaded running the executable will start the installation procedure, you will be prompted for location and so on. When the installation procedure prompts for the product to be installed, make sure you select Visual Paradigm for UML.</p>
<p><img class="alignnone size-medium wp-image-74" title="vp_setup_screen" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_setup_screen-300x250.png" alt="vp_setup_screen" width="300" height="250" /></p>
<p>The next dialog to be displayed prompts for the edition to be used,  select the Community Edition as that is free for personal use.</p>
<p><img class="alignnone size-full wp-image-75" title="vp_edition_screen" src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_edition_screen.jpg" alt="vp_edition_screen" width="500" height="417" /></p>
<p><img class="alignright size-medium wp-image-89" title="VisuaL Paradigm License " src="http://www.fuzzymargins.com/wp-content/uploads/2008/12/vp_license_window-300x250.png" alt="VisuaL Paradigm License " width="300" height="250" /></p>
<p>The final dialog prompts for the license to be used. Select the Single License Key option and in the file path box enter the path and the name of the license key file that was attached to the registration email.</p>
<p>That pretty much completes the installation. When you first run Visual Paradigm you will be prompted for a workspace which is where all of the diagrams you create will be stored.  Make sure this is set to a path of a location that does get included in backups, particularly if you plan to create diagrams that would be difficult to recreate if they were lost due to a disk crash.</p>
<p>The next part of this article will describe how to get started with  Visual Paradigm and how to create the first Entity Relationship diagram.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2008/12/installing-the-free-edition-of-visual-paradigm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
