<?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/"
	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>Andrew Harvey&#039;s Blog &#187; comp3311</title>
	<atom:link href="http://andrewharvey4.wordpress.com/tag/comp3311/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewharvey4.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Dec 2009 23:25:25 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='andrewharvey4.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/574c934288b8ec9b24c519954a9bc2be?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Andrew Harvey&#039;s Blog &#187; comp3311</title>
		<link>http://andrewharvey4.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://andrewharvey4.wordpress.com/osd.xml" title="Andrew Harvey&#039;s Blog" />
		<item>
		<title>PostgreSQL Very Basic Cheatsheet</title>
		<link>http://andrewharvey4.wordpress.com/2009/05/05/postgresql-very-basic-cheatsheet/</link>
		<comments>http://andrewharvey4.wordpress.com/2009/05/05/postgresql-very-basic-cheatsheet/#comments</comments>
		<pubDate>Tue, 05 May 2009 10:06:08 +0000</pubDate>
		<dc:creator>Andrew Harvey</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[comp3311]]></category>

		<guid isPermaLink="false">http://andrewharvey4.wordpress.com/?p=490</guid>
		<description><![CDATA[(Wrote this a few weeks ago when I knew nothing. Indented into my brain now. Should have published earlier or just trashed the post as it seems too simple now. So instead I&#8217;ll update it when I find out some new neat tricks.)
List of databases:
$ psql -l
To open one of them,
$ psql MyDatabase
To see what [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=490&subd=andrewharvey4&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>(Wrote this a few weeks ago when I knew nothing. Indented into my brain now. Should have published earlier or just trashed the post as it seems too simple now. So instead I&#8217;ll update it when I find out some new neat tricks.)</em></p>
<p>List of databases:<br />
$ psql -l</p>
<p>To open one of them,<br />
$ psql MyDatabase</p>
<p>To see what is in the database (list of relations),<br />
mydb=# \d</p>
<p>To examine a specific table,<br />
mydb=# \d TableName</p>
<p>Can execute SQL,<br />
mydb=# select * from Table;</p>
<p>Can edit SQL in an editor from within PSQL,<br />
mydb=# \e</p>
<p>To quit,<br />
mydb=# \q</p>
<p>To load a schema from a file<br />
$ psql mydb -f /home/foo/bar</p>
<p>Also from the shell,<br />
$ pg_dump -O myDB &gt; file<br />
(-O means no ownership information is outputed)</p>
<p>On my server configuration (default for ubuntu) you can restart the PostgreSQL service using,<br />
$ sudo /etc/init.d/postgresql-8.3 restart</p>
Posted in computing Tagged: comp3311, computing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewharvey4.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewharvey4.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewharvey4.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewharvey4.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewharvey4.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewharvey4.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewharvey4.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewharvey4.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewharvey4.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewharvey4.wordpress.com/490/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=490&subd=andrewharvey4&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewharvey4.wordpress.com/2009/05/05/postgresql-very-basic-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28043c88c4d0c2700ec793045d0ebe91?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">andrewharvey4</media:title>
		</media:content>
	</item>
		<item>
		<title>COMP3311 &#8211; Week 7 Notes</title>
		<link>http://andrewharvey4.wordpress.com/2009/05/05/comp3311-week-7-notes/</link>
		<comments>http://andrewharvey4.wordpress.com/2009/05/05/comp3311-week-7-notes/#comments</comments>
		<pubDate>Tue, 05 May 2009 09:53:41 +0000</pubDate>
		<dc:creator>Andrew Harvey</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[comp3311]]></category>

		<guid isPermaLink="false">http://andrewharvey4.wordpress.com/?p=500</guid>
		<description><![CDATA[Its pointless repeating what John put in the lecture slides, so this is just my additions that he mentioned but are not in the slides.
Aggregates
Initial condition is defaulted to NULL. So sometimes you will need to define,
  initcond = '';
This is different to NULL, because,
  null &#124;&#124; 'abc' --&#62; null
(where &#124;&#124; is append) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=500&subd=andrewharvey4&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Its pointless repeating what John put in the lecture slides, so this is just my additions that he mentioned but are not in the slides.</p>
<h2>Aggregates</h2>
<p>Initial condition is defaulted to NULL. So sometimes you will need to define,</p>
<pre>  initcond = '';</pre>
<p>This is different to NULL, because,</p>
<pre>  null || 'abc' --&gt; null</pre>
<p>(where || is append) but</p>
<pre>  '' || 'abc' --&gt; 'abc'</pre>
<h2>PHP</h2>
<pre>$x = 2;
myFunc() {
  global $x;
}</pre>
<p>If we omit the global $x, then any references to $x in myFunc will refer to a new local x, not the first x that is set to 2. To avoid this and force any references to x inside myFunc to refer to the first x that is equal to 2, we need this global $x line.</p>
<h2>strpos</h2>
<pre>1. $i = strpos('abc', 'a') --&gt; 0
2. $i = strpos('abc', 'b') --&gt; 1
3. $i = strpos('abc', 'z') --&gt; false</pre>
<p>if($i) will only be true in case 2 (false in case 1 and 3). So if we want to test if the second string was at all in the first string we must use,</p>
<pre>if($i !== false)</pre>
<p>This one will be true in case 1 and 2, but not 3.</p>
Posted in computing Tagged: comp3311, computing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewharvey4.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewharvey4.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewharvey4.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewharvey4.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewharvey4.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewharvey4.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewharvey4.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewharvey4.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewharvey4.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewharvey4.wordpress.com/500/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=500&subd=andrewharvey4&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewharvey4.wordpress.com/2009/05/05/comp3311-week-7-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28043c88c4d0c2700ec793045d0ebe91?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">andrewharvey4</media:title>
		</media:content>
	</item>
		<item>
		<title>COMP3311 &#8211; Wk3-4 General Notes</title>
		<link>http://andrewharvey4.wordpress.com/2009/04/10/comp3311-wk3-4-general-notes/</link>
		<comments>http://andrewharvey4.wordpress.com/2009/04/10/comp3311-wk3-4-general-notes/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 04:21:18 +0000</pubDate>
		<dc:creator>Andrew Harvey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[comp3311]]></category>

		<guid isPermaLink="false">http://andrewharvey4.wordpress.com/?p=431</guid>
		<description><![CDATA[Constraint Checking
If you use the keyword CONSTRAINT, you also need to provide a name for the constraint. However, it is permitted to omit both the keyword CONSTRAINT and the constraint name. In other words constraint definitions can be either
CONSTRAINT constraint_name CHECK ( expression )
or just
CHECK ( expression )
With respect to the expression,
x = NULL --this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=431&subd=andrewharvey4&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h2>Constraint Checking</h2>
<p>If you use the keyword CONSTRAINT, you also need to provide a name for the constraint. However, it is permitted to omit both the keyword CONSTRAINT and the constraint name. In other words constraint definitions can be either</p>
<pre>CONSTRAINT constraint_name CHECK ( expression )</pre>
<p>or just</p>
<pre>CHECK ( expression )</pre>
<p>With respect to the expression,</p>
<pre>x = NULL --this is always false
x IS NULL --returns true if x is null, and false otherwise</pre>
<ul>
<li>You should add as many constraints to the database as needed for the data to make sense and is valid. Its probably bad practice to push this off to the application programming level in say PHP. There is probably a lot more to this though.</li>
</ul>
<h2>Queries</h2>
<p>Standard paradigm for accessing DB from app.code:</p>
<pre>-- establish connection to DBMS
db = dbConnect("dbname=X user=Y passwd=Z");
query = "select a,b from R,S where ... ";
-- invoke query and get handle to result set
results = dbQuery(db, query);
-- for each tuple in result set
while (tuple = dbNext(results)) {
-- process next tuple
process(val(tuple,'a'), val(tuple,'b'));
} dbClose(results);</pre>
<ul>
<li>The important point here is as much as possibly you should try to grab as much data as you need from one SQL query with one call to the DB. Rather than just grabbing the whole database and getting the parts you need in the rest of your program (eg. PHP). I can see how this method would be tempting, but I can also see that its a bad approach.</li>
</ul>
<h2>Views</h2>
<pre>create view <em>name</em> as select ...</pre>
<p>This makes a &#8220;virtual table&#8221; called name that you can use in your subsequent SQL queries, but the table will dissapear when the connection is closed (or at least this is when I think it dissapears).</p>
<h2>pg_dump</h2>
<pre>pg_dump dbname &gt; file</pre>
<p>This will dump the whole database (in SQL format) to a file. Use -o to ommit the ownership data.</p>
<h2>Enforcing Case</h2>
<p>SQL is case insensitive, to enforce case use double quotes. eg. select name as &#8220;Foo&#8221; from bar;</p>
<h2>Foreign Keys</h2>
<p>Just because an attribute in a foreign key does not automatically imply that it is not null. It may be NULL. If  you want the attribute to never be NULL you must add NOT NULL.</p>
Posted in Uncategorized Tagged: comp3311 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewharvey4.wordpress.com/431/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewharvey4.wordpress.com/431/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewharvey4.wordpress.com/431/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewharvey4.wordpress.com/431/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewharvey4.wordpress.com/431/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewharvey4.wordpress.com/431/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewharvey4.wordpress.com/431/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewharvey4.wordpress.com/431/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewharvey4.wordpress.com/431/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewharvey4.wordpress.com/431/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=431&subd=andrewharvey4&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewharvey4.wordpress.com/2009/04/10/comp3311-wk3-4-general-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28043c88c4d0c2700ec793045d0ebe91?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">andrewharvey4</media:title>
		</media:content>
	</item>
		<item>
		<title>COMP3311 Wk02</title>
		<link>http://andrewharvey4.wordpress.com/2009/03/26/comp3311-wk02/</link>
		<comments>http://andrewharvey4.wordpress.com/2009/03/26/comp3311-wk02/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 23:50:14 +0000</pubDate>
		<dc:creator>Andrew Harvey</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[comp3311]]></category>

		<guid isPermaLink="false">http://andrewharvey4.wordpress.com/?p=408</guid>
		<description><![CDATA[Various things about mapping ER Designs to Relational Schemas.
Mapping Strong Entities

The relational model supports only atomic attributes. To map composite attributes you can try,

Concatenate the attributes eg. Struct name {&#8220;John&#8221;, &#8220;Smith&#8221;} &#8211;&#62; &#8220;John Smith&#8221;
Map atomic components of the composite attribute to a set of atomic components. eg.


??

Mapping N:M Relations

Mapping 1:N Relations
Mapping 1:1 Relations

Notes from the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=408&subd=andrewharvey4&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Various things about mapping ER Designs to Relational Schemas.</p>
<h2>Mapping Strong Entities</h2>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/strongent.png"><img class="aligncenter size-full wp-image-412" title="strongent" src="http://andrewharvey4.files.wordpress.com/2009/03/strongent.png?w=450&#038;h=116" alt="strongent" width="450" height="116" /></a></p>
<p>The relational model supports only atomic attributes. To map composite attributes you can try,</p>
<ol>
<li>Concatenate the attributes eg. Struct name {&#8220;John&#8221;, &#8220;Smith&#8221;} &#8211;&gt; &#8220;John Smith&#8221;</li>
<li>Map atomic components of the composite attribute to a set of atomic components. eg.<br />
<a href="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt1.png"><img class="aligncenter size-medium wp-image-410" title="mapcompatt1" src="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt1.png?w=300&#038;h=235" alt="mapcompatt1" width="300" height="235" /><br />
</a><a href="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt_table.png"><img class="aligncenter size-full wp-image-411" title="mapcompatt_table" src="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt_table.png?w=276&#038;h=69" alt="mapcompatt_table" width="276" height="69" /></a></li>
<li>??</li>
</ol>
<h2>Mapping N:M Relations</h2>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/mapnnrel.png"><img class="aligncenter size-full wp-image-407" title="mapnnrel" src="http://andrewharvey4.files.wordpress.com/2009/03/mapnnrel.png?w=450&#038;h=394" alt="mapnnrel" width="450" height="394" /></a></p>
<h2>Mapping 1:N Relations</h2>
<h2><a href="http://andrewharvey4.files.wordpress.com/2009/03/map1nrel2.png"><img class="aligncenter size-full wp-image-413" title="map1nrel2" src="http://andrewharvey4.files.wordpress.com/2009/03/map1nrel2.png?w=450&#038;h=338" alt="map1nrel2" width="450" height="338" /></a>Mapping 1:1 Relations</h2>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/map11rel.png"><img class="aligncenter size-full wp-image-414" title="map11rel" src="http://andrewharvey4.files.wordpress.com/2009/03/map11rel.png?w=450&#038;h=338" alt="map11rel" width="450" height="338" /></a></p>
<h2>Notes from the Text Book (The Lecture Notes are a Little Different)</h2>
<h3>Domain Types &amp; User Types</h3>
<p>In the sample code for the first assignment to define &#8220;custom types&#8221; create domain is used. eg.</p>
<pre>create domain PersonGender as char(1) check (value in ('M','F'));</pre>
<p>However the text also shows create type. eg.</p>
<pre>create type Dollars as numeric(12,2) final</pre>
<p>It goes on to explain the difference.</p>
<ul>
<li>Domains can have constraints (such as <strong>not null</strong>) specified on them, as well as default values defined on the domain type. You can&#8217;t do this with user defined types.</li>
<li>Domains are not strongly typed. Hence you can assign values of one domain type to values of another domain type so long as the underlying types are compatible.</li>
</ul>
<h3>Pattern Matching</h3>
<p>Patterns in SQL can be desribed using % and _.</p>
<ul>
<li>Percent (%): The % character matches any substring.</li>
<li>Underscore (_): The _ character matches any character.</li>
</ul>
<p>eg.</p>
<pre><strong>select</strong> foo <strong>from</strong> bar <strong>where</strong> lar <strong>like</strong> '_to%'</pre>
<p>This will match to any of these strings, &#8220;Lto&#8221; &#8220;Ato&#8221; &#8220;ltoo&#8221; &#8220;rtoto&#8221; &#8230; (any character at the start, then the &#8220;to&#8221; string, then any (even null) trailing string)</p>
<p>You can define the escape character for a like comparison as follows,</p>
<pre><strong>like</strong> 'he\%%'  <strong>escape</strong> '\'' --matches all strings begining with 'he%'</pre>
<p>You can also use <strong>not like</strong>.</p>
<p>SQL:1999 allows for <strong>similar too</strong> which is similar to Unix regular expressions.</p>
<h3>Drop vs. Delete</h3>
<p>drop table r will remove all the tuples from r, and removes the schema of r, whereas</p>
<p>delete from r will just remove all the tuples from r, but leaving the schema so you can still add values to the table.</p>
<h2>References</h2>
<p>Shepherd, John. COMP3311 09s1 Lecture Slides. <a href="http://www.cse.unsw.edu.au/~cs3311/09s1/lectures/">http://www.cse.unsw.edu.au/~cs3311/09s1/lectures/</a>. (Diagrams have also been sourced from here).</p>
<p>Silberschatz. Database System Concepts. 5th Ed.</p>
Posted in computing Tagged: comp3311, computing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewharvey4.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewharvey4.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewharvey4.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewharvey4.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewharvey4.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewharvey4.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewharvey4.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewharvey4.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewharvey4.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewharvey4.wordpress.com/408/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=408&subd=andrewharvey4&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewharvey4.wordpress.com/2009/03/26/comp3311-wk02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28043c88c4d0c2700ec793045d0ebe91?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">andrewharvey4</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/strongent.png" medium="image">
			<media:title type="html">strongent</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt1.png?w=300" medium="image">
			<media:title type="html">mapcompatt1</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/mapcompatt_table.png" medium="image">
			<media:title type="html">mapcompatt_table</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/mapnnrel.png" medium="image">
			<media:title type="html">mapnnrel</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/map1nrel2.png" medium="image">
			<media:title type="html">map1nrel2</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/map11rel.png" medium="image">
			<media:title type="html">map11rel</media:title>
		</media:content>
	</item>
		<item>
		<title>COMP3311 &#8211; Wk01</title>
		<link>http://andrewharvey4.wordpress.com/2009/03/23/comp3311-wk01/</link>
		<comments>http://andrewharvey4.wordpress.com/2009/03/23/comp3311-wk01/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 09:42:18 +0000</pubDate>
		<dc:creator>Andrew Harvey</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[comp3311]]></category>

		<guid isPermaLink="false">http://andrewharvey4.wordpress.com/?p=400</guid>
		<description><![CDATA[Just a couple random notes, to reiterate some things I need to become acquainted with. Definitely not comprehensive.
The ER Diagram
Cardinalities


Each manager manages exactly one branch, and each branch is managed by exactly one manager.
Each branch holds zero or more accounts, but each account is held be at most one branch.
Each customer owns zero or more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=400&subd=andrewharvey4&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just a couple random notes, to reiterate some things I need to become acquainted with. Definitely not comprehensive.</p>
<h2>The ER Diagram</h2>
<h3>Cardinalities</h3>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/cardinal.png"><img class="aligncenter size-full wp-image-401" title="cardinal" src="http://andrewharvey4.files.wordpress.com/2009/03/cardinal.png?w=449&#038;h=215" alt="cardinal" width="449" height="215" /></a></p>
<ol>
<li>Each manager manages exactly one branch, and each branch is managed by exactly one manager.</li>
<li>Each branch holds zero or more accounts, but each account is held be at most one branch.</li>
<li>Each customer owns zero or more accounts and each account is owned by zero or more customers.</li>
</ol>
<h3>Participation</h3>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/particip.png"><img class="aligncenter size-full wp-image-402" title="particip" src="http://andrewharvey4.files.wordpress.com/2009/03/particip.png?w=450&#038;h=72" alt="particip" width="450" height="72" /></a>Not all customers must take out a loan (or it is not the case that every customer takes out a loan), but every loan is taken out by at least one customer. i.e. Every loan is associated with at least one person, but every person is <strong>not</strong> necessarily associated with at least one loan.</p>
<h3>Attributes Linked to Relationships</h3>
<p><a href="http://andrewharvey4.files.wordpress.com/2009/03/workson.png"><img class="aligncenter size-full wp-image-403" title="workson" src="http://andrewharvey4.files.wordpress.com/2009/03/workson.png?w=450&#038;h=126" alt="workson" width="450" height="126" /></a></p>
<p>In (a) you know how much time a particular person spends on a project. In (b) you only know how much time has been spend on a particular project. You don&#8217;t know the distribution of that time among the researches that have worked on it.</p>
<h2>References</h2>
<p>Shepherd, John. COMP3311 09s1 Lecture Slides. <a href="http://www.cse.unsw.edu.au/~cs3311/09s1/lectures/">http://www.cse.unsw.edu.au/~cs3311/09s1/lectures/</a>. (Diagrams have also been sourced from here).</p>
Posted in computing Tagged: comp3311, computing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewharvey4.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewharvey4.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewharvey4.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewharvey4.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewharvey4.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewharvey4.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewharvey4.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewharvey4.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewharvey4.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewharvey4.wordpress.com/400/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewharvey4.wordpress.com&blog=5148276&post=400&subd=andrewharvey4&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewharvey4.wordpress.com/2009/03/23/comp3311-wk01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28043c88c4d0c2700ec793045d0ebe91?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">andrewharvey4</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/cardinal.png" medium="image">
			<media:title type="html">cardinal</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/particip.png" medium="image">
			<media:title type="html">particip</media:title>
		</media:content>

		<media:content url="http://andrewharvey4.files.wordpress.com/2009/03/workson.png" medium="image">
			<media:title type="html">workson</media:title>
		</media:content>
	</item>
	</channel>
</rss>