London Underground Map Data - SQL Files

London Underground Map Data - SQL Files

There are two parts to this: the DDL files (Data Definition Language) defining the relational database tables; and the SQL file which inserts the station data into these tables.

Note that the DDL files in particular were generated to be run against an Oracle7 database (the headers say Oracle 8 because it was an O8 database I was running against, but there are no O8 features used in these tables). As such, there are certain datatypes and conventions for declarative constraints which won't be directly runnable against other databases, although I have managed to get a version of these tables into MS Access.

Strictly speaking, you can get away with just the tables since the queries that are run tend to explicitly equate the identifying fields anyway, but the constraints and index are useful optimisations (eg the database should check for you that the primary key field is unique, or that a foreign key value matches up with a real row).

TypeFileComment
DDL MAPDATA.SQL O7 comes with a script execution tool called SQL*Plus, and you would normally run this script from that tool.
This is the top level script, and invokes the others.
MAPDATA.TAB Creates the tables.
MAPDATA.CON Specifies the constraints on the tables, including primary and foreign keys.
MAPDATA.IND Creates indexes on the tables (well, one anyway).
SQL STATIONS.SQL Inserts data into the relational tables in the order LINE, STATION, STATION_NODE, LINE_SEGMENT.