<?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=Congestion_Hard2&amp;feed=atom&amp;action=history</id>
		<title>Congestion Hard2 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Congestion_Hard2&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Congestion_Hard2&amp;action=history"/>
		<updated>2013-05-25T01:59:31Z</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=Congestion_Hard2&amp;diff=1945&amp;oldid=prev</id>
		<title>Connor: Created page with &quot;&lt;h1&gt;Congestion Charges: hard questions&lt;/h1&gt; &lt;p&gt;11 and 12 concern charging days. Saturday and Sunday are not charging days. In addition the following public holidays are not ch...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Congestion_Hard2&amp;diff=1945&amp;oldid=prev"/>
				<updated>2012-07-19T14:56:56Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;h1&amp;gt;Congestion Charges: hard questions&amp;lt;/h1&amp;gt; &amp;lt;p&amp;gt;11 and 12 concern charging days. Saturday and Sunday are not charging days. In addition the following public holidays are not ch...&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 Charges: hard questions&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;11 and 12 concern charging days. Saturday and Sunday are not charging days. In addition the following public holidays are not charging days:&lt;br /&gt;
March 21st 2003&lt;br /&gt;
March 31st 2003&lt;br /&gt;
May 1st 2003&lt;br /&gt;
May 20th 2003&lt;br /&gt;
To answer 11 or 12 you will need to record these non-charging days using a table or view&lt;br /&gt;
You may need to create views to complete these questions - but you do not have permission to create tables or views in the default schema.&lt;br /&gt;
Your SQL commands are executed by user '''scott''' in schema '''gisq''' - you may create or drop views and tables in schema '''scott''' but not in '''gisq'''.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
When creating a view in scott you must specify the schema name of the sources and the destination.    &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
DROP VIEW scott.high_value;&lt;br /&gt;
CREATE VIEW scott.high_value AS&lt;br /&gt;
SELECT * FROM gisq.tprod&lt;br /&gt;
  WHERE pric&amp;gt;50;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM scott.high_value&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;
Anomalous daily permits.&lt;br /&gt;
Daily permits should not be issued for non-charging days. &lt;br /&gt;
Find a way to represent non-charging days. Identify the anomalous daily permits.    &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&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;
Permit duration.&lt;br /&gt;
You can pay your congestion charge daily, weekly (representing 5 consecutive charging days), monthly (20 consecutive charging days), or annually (252 consecutive charging days). The field lDate is intended to hold the last date for each permit - it is currently null. &lt;br /&gt;
Create a query to calculate the correct lDate for each permit and change each record. &lt;br /&gt;
Note that you do not have permission to execute such as query on the share table so you should take your own copy. &lt;br /&gt;
Demonstrate your answer by showing the start date, chargeType and last last Date for permits with a start date in Jan 2003.&lt;br /&gt;
[[A question from Jim]]   &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&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;
Issue fines.&lt;br /&gt;
Vehicles using the zone during the charge period, on charging days must be issued with fine notices unless they have a permit covering that day. &lt;br /&gt;
List the name and address of such culprits, give the camera and the date and time of the first offence. &lt;br /&gt;
The charging period is from 7am to 6:30pm     &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&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;
Copied plates.&lt;br /&gt;
Cars may enter and leave the charging zone any number of times however certain patterns of behaviour are regarded as suspicious: Cars which enter the zone twice between 07:00 and 09:00 Cars which enter the zone three times but leave only once We are suspicious that the same registration number plate is on more than one vehicle. &lt;br /&gt;
Define suspicious behaviour and create a query that will identify suspected registration plates.      &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&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;
Speeders.&lt;br /&gt;
The fastest legal time from camera 18 to camera 9 is 2 minutes. Car SO 02 RSP did the trip in 1 minute and should be fined for speeding. Find a way to record the fastest legal time between pairs of cameras, make up five such values and identify the speeders.      &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&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>