A Gentle Introduction to

SQL

GISQ: Assessment - Congestion Charging

Pick an engine:

Congestion Charging database

Graduated questions

ER diagram for the Congestion Charging database:

Camera(id, perim)
Keeper(id, name, address)
Vehicle(id, keeper)
Image(camera, whn, reg)
Permit(reg, sDate, lDate, chargeType)

SQL Source to create the database,
SQL Source to populate the tables.

Sample query

0a
List the vehicles for which 'Strenuous, Sam' is the registered keeper.
The link between Keepers and Vehicles is via the foreign key specified in the CREATE TABLE Vehicle statement. Note the line
 ,FOREIGN KEY(keeper) REFERENCES Keeper(id) 
This will be the basis of our join condition.