CT230 Lab 6

http://geminga.it.nuigalway.ie/~gettrick/courses/CT230/labs/lab6.html



This is the last Practical for CT230. We will work with subqueries, UPDATEs DELETEs and some operators from set theory such as UNION. Open the database at

http://geminga.it.nuigalway.ie/~gettrick/courses/CT230/labs/cars.mdb

Click on the Queries tab (next to the Tables tab) and then click on New. Open the Query under Design View. In the resulting Show Table window that appears just click on Close. Now from the View menu in the top title bar select SQL View. You should now have a single Select; Query. Delete this. Now for each of the following type in the SQL query given and run it to see the result.

TO BE HANDED IN
Write SQL queries to
  1. output the Codes for Offences in descending date order (i.e. code for most recent offence first)

  2. delete from the table of Officers any Officers whose surname comes (alphabetically) after "Conroy"

  3. correct an error whereby after January 1st, 1998, Offences that were in fact reported by Officer 567 were recorded instead as having been reported by Officer 513.

  4. update all the entries in Offence.Code by multiplying them by 10.

  5. output the names of Car Owners and Surnames of Officers in one long list.

© NUI, Galway