<?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=Old_Congestion&amp;feed=atom&amp;action=history</id>
		<title>Old Congestion - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Old_Congestion&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Old_Congestion&amp;action=history"/>
		<updated>2013-06-20T03:19:37Z</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=Old_Congestion&amp;diff=1942&amp;oldid=prev</id>
		<title>Connor: Created page with &quot;&lt;h1&gt;Congestion charging database&lt;/h1&gt; &lt;p&gt;Graduated questions&lt;/p&gt; &lt;ul&gt;  &lt;li&gt;Easy questions: 1..5&lt;/li&gt;  &lt;li&gt;Medium questions: 6..10...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Old_Congestion&amp;diff=1942&amp;oldid=prev"/>
				<updated>2012-07-19T14:47:49Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;h1&amp;gt;Congestion charging database&amp;lt;/h1&amp;gt; &amp;lt;p&amp;gt;Graduated questions&amp;lt;/p&amp;gt; &amp;lt;ul&amp;gt;  &amp;lt;li&amp;gt;&lt;a href=&quot;/wiki/Congestion_Easy2&quot; title=&quot;Congestion Easy2&quot;&gt;Easy questions: 1..5&lt;/a&gt;&amp;lt;/li&amp;gt;  &amp;lt;li&amp;gt;&lt;a href=&quot;/wiki/Congestion_Medium2&quot; title=&quot;Congestion Medium2&quot;&gt;Medium questions: 6..10&lt;/a&gt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;h1&amp;gt;Congestion charging database&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Graduated questions&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;[[Congestion Easy2 |Easy questions: 1..5]]&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;[[Congestion Medium2 |Medium questions: 6..10]]&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;[[Congestion Hard2 |Hard questions: 11..15]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;ER diagram for the Congestion charging database:&amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:/pics/er5.gif]]&lt;br /&gt;
&amp;lt;p&amp;gt;camera(id, perim)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;keeper(id, name, address)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;vehicle(id, keeper)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;image(camera, whn, reg)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;permit(reg, sDate, chargeType)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Sample query&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
List the vehicles for which 'Strenuous, Sam' is the registered keeper.&lt;br /&gt;
The link between Keepers and Vehicles is via the foreign key specified in the CREATE TABLE vehicle statement. Note the line:&lt;br /&gt;
  ,FOREIGN KEY(keeper) REFERENCES keeper(id)&lt;br /&gt;
This will be the basis of our join condition.&lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
SELECT vehicle.id&lt;br /&gt;
  FROM vehicle JOIN keeper&lt;br /&gt;
        ON vehicle.keeper = keeper.id&lt;br /&gt;
   WHERE keeper.name = 'Strenuous, Sam' &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>