rail operator railports table structure

rail operator railports table structure#

List of rail operators by railports in the model

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

rail_operator

INTEGER

NO

0

Rail_Operator(rail_operator)

The unique identifier of the rail operator as in the Rail_Operator table

railport

INTEGER

NO

0

Railport(railport)

The unique identifier of the railport as in the Railports table

(* - Primary key)

The SQL statement for table and index creation is below.

CREATE TABLE Rail_Operator_Railports (
    "rail_operator" INTEGER NOT NULL DEFAULT 0,
    "railport"      INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT railport_fk FOREIGN KEY (railport)
    REFERENCES Railport (railport) DEFERRABLE INITIALLY DEFERRED
    CONSTRAINT rail_operator_rp_fk FOREIGN KEY (rail_operator)
    REFERENCES Rail_Operator (rail_operator) DEFERRABLE INITIALLY DEFERRED
);