{"railway": {"columns": [[0, "Railway_ID", "INT", 0, null, 1], [1, "Railway", "TEXT", 0, null, 0], [2, "Builder", "TEXT", 0, null, 0], [3, "Built", "TEXT", 0, null, 0], [4, "Wheels", "TEXT", 0, null, 0], [5, "Location", "TEXT", 0, null, 0], [6, "ObjectNumber", "TEXT", 0, null, 0]], "primary_keys": ["Railway_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Railway_ID"]]], "check_constraints": []}, "train": {"columns": [[0, "Train_ID", "INT", 0, null, 1], [1, "Train_Num", "TEXT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "From", "TEXT", 0, null, 0], [4, "Arrival", "TEXT", 0, null, 0], [5, "Railway_ID", "INT", 0, null, 0]], "primary_keys": ["Train_ID"], "foreign_keys": [[0, 0, "railway", "Railway_ID", "Railway_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Train_ID"]]], "check_constraints": []}, "manager": {"columns": [[0, "Manager_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Working_year_starts", "TEXT", 0, null, 0], [4, "Age", "INT", 0, null, 0], [5, "Level", "INT", 0, null, 0]], "primary_keys": ["Manager_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Manager_ID"]]], "check_constraints": []}, "railway_manage": {"columns": [[0, "Railway_ID", "INT", 0, null, 1], [1, "Manager_ID", "INT", 0, null, 2], [2, "From_Year", "TEXT", 0, null, 0]], "primary_keys": ["Railway_ID", "Manager_ID"], "foreign_keys": [[0, 0, "railway", "Railway_ID", "Railway_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "manager", "Manager_ID", "Manager_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Railway_ID"], [1, 1, "Manager_ID"]]], "check_constraints": []}}
CREATE TABLE railway (
    Railway_ID INT   PRIMARY KEY,
    Railway TEXT,
    Builder TEXT,
    Built TEXT,
    Wheels TEXT,
    Location TEXT,
    ObjectNumber TEXT,
    UNIQUE (Railway_ID)
);

CREATE TABLE train (
    Train_ID INT   PRIMARY KEY,
    Train_Num TEXT,
    Name TEXT,
    From TEXT,
    Arrival TEXT,
    Railway_ID INT,
    UNIQUE (Train_ID),
    FOREIGN KEY (Railway_ID) REFERENCES railway(Railway_ID)
);

CREATE TABLE manager (
    Manager_ID INT   PRIMARY KEY,
    Name TEXT,
    Country TEXT,
    Working_year_starts TEXT,
    Age INT,
    Level INT,
    UNIQUE (Manager_ID)
);

CREATE TABLE railway_manage (
    Railway_ID INT   PRIMARY KEY,
    Manager_ID INT   PRIMARY KEY,
    From_Year TEXT,
    PRIMARY KEY (Railway_ID, Manager_ID),
    UNIQUE (Railway_ID, Manager_ID),
    FOREIGN KEY (Railway_ID) REFERENCES railway(Railway_ID),
    FOREIGN KEY (Manager_ID) REFERENCES manager(Manager_ID)
);