<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://sqlzoo.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;feed=atom&amp;action=history</id>
		<title>Scottish Parliament - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;action=history"/>
		<updated>2013-05-24T16:52:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1695&amp;oldid=prev</id>
		<title>Connor at 09:23, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1695&amp;oldid=prev"/>
				<updated>2012-07-18T09:23:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:23, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 119:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 119:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Self_join |Self joins are the topic for the next tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Self_join |Self joins are the topic for the next tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/hr&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;Note&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;Note&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Sadly Donald Dewar died in 2000. An able and popular leader of the Labour Party in Scotland.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Sadly Donald Dewar died in 2000. An able and popular leader of the Labour Party in Scotland.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1694&amp;oldid=prev</id>
		<title>Connor at 09:22, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1694&amp;oldid=prev"/>
				<updated>2012-07-18T09:22:21Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:22, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Self_join |Self joins are the topic for the next tutorial]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/hr&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;h2&amp;gt;Note&amp;lt;/h2&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;p&amp;gt;Sadly Donald Dewar died in 2000. An able and popular leader of the Labour Party in Scotland.&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1689&amp;oldid=prev</id>
		<title>Connor at 09:14, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1689&amp;oldid=prev"/>
				<updated>2012-07-18T09:14:28Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:14, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;/table&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;/table&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Selecting NULL values]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Selecting_NULL_values. |&lt;/ins&gt;Selecting NULL values]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;Dealing wit &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;Dealing wit &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1014&amp;oldid=prev</id>
		<title>Connor: Created page with &quot;&lt;h3&gt;Scottish Parliament&lt;/h3&gt; The data includes all Members of the Scottish Parliament (MSPs) in 1999. Most MSPs belong to a political party. Some parties have a leader who is ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Scottish_Parliament&amp;diff=1014&amp;oldid=prev"/>
				<updated>2012-07-12T10:54:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;h3&amp;gt;Scottish Parliament&amp;lt;/h3&amp;gt; The data includes all Members of the Scottish Parliament (MSPs) in 1999. Most MSPs belong to a political party. Some parties have a leader who is ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;h3&amp;gt;Scottish Parliament&amp;lt;/h3&amp;gt;&lt;br /&gt;
The data includes all Members of the Scottish Parliament (MSPs) in 1999. Most MSPs belong to a political party. Some parties have a leader who is an MSP. There are two tables:&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;caption&amp;gt;msp&amp;lt;/caption&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;  &lt;br /&gt;
      &amp;lt;th &amp;gt;Name&amp;lt;/th&amp;gt;      &lt;br /&gt;
      &amp;lt;th &amp;gt;Party&amp;lt;/th&amp;gt;      &lt;br /&gt;
      &amp;lt;th &amp;gt;Constituency&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Adam MSP, Brian&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;SNP&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;North East Scotland&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Aitken MSP, Bill&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Con&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Glasgow&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Alexander MSP, Ms Wendy&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Lab&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Paisley North&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;i&amp;gt;... Total number of records: 129&amp;lt;/i&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;caption&amp;gt;party&amp;lt;/caption&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;  &lt;br /&gt;
      &amp;lt;th &amp;gt;Code&amp;lt;/th&amp;gt;      &lt;br /&gt;
      &amp;lt;th &amp;gt;Name&amp;lt;/th&amp;gt;      &lt;br /&gt;
      &amp;lt;th &amp;gt;Leader&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Con&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Conservative&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;McLetchie MSP, David&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Green&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Green&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;td &amp;gt;Lab&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Labour&amp;lt;/td&amp;gt;&amp;lt;td &amp;gt;Dewar MSP, Rt Hon Donald&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;i&amp;gt;... Total number of records: 9&amp;lt;/i&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Selecting NULL values]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Dealing wit &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
One MSP was kicked out of the Labour party and has no party. Find him.&lt;br /&gt;
&amp;lt;div class='hint' title='Why we cannot use ='&amp;gt;&lt;br /&gt;
You might think that the phrase dept=NULL would work here. It doesn't. This is because NULL &amp;quot;propogates&amp;quot;. Any normal expression that includes NULL is itself NULL, thus the value of the expressions 2+NULL and party || NULL and NULL=NULL for example are all NULL.&lt;br /&gt;
&amp;lt;div title=&amp;quot;Theory&amp;quot; class='hint'&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; value does not cause a type error, however it does infect everything it touches with &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;-ness. We call this element the &amp;lt;code&amp;gt;bottom&amp;lt;/code&amp;gt; value for the algebra - but we don't snigger because we are grown-ups. [http://c2.com/cgi/wiki?BottomType Bottom Type.]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;  &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT name FROM msp WHERE party IS NULL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
Obtain a list of all parties and leaders. &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT name, leader FROM party&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
Give the party and the leader for the parties which have leaders.  &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT name, leader FROM party&lt;br /&gt;
  WHERE leader IS NOT NUL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
Obtain a list of all parties which have at least one MSP. &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT DISTINCT party.name FROM msp, party&lt;br /&gt;
  WHERE party=code&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Outer joins]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
Obtain a list of all MSPs by name, give the name of the MSP and the name of the party where available. Be sure that &amp;lt;code&amp;gt;Canavan MSP, Dennis&amp;lt;/code&amp;gt; is in the list.&lt;br /&gt;
Use ORDER BY msp.name to sort your output by MSP.  &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT msp.name, party.name&lt;br /&gt;
  FROM msp LEFT JOIN party ON party=code&lt;br /&gt;
  ORDER BY msp.name&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
Obtain a list of parties which have MSPs, include the number of MSPs.  &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT party.name, COUNT(msp.name)&lt;br /&gt;
  FROM msp, party&lt;br /&gt;
  WHERE msp.party=party.code&lt;br /&gt;
  GROUP BY party.name&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
A list of parties with the number of MSPs; include parties with no MSPs. &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='ans'&amp;gt;&lt;br /&gt;
SELECT party.name, COUNT(msp.name)&lt;br /&gt;
  FROM party &lt;br /&gt;
  LEFT JOIN msp ON party.code=msp.party&lt;br /&gt;
  GROUP BY party.name&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	</feed>