{"battle": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "date", "TEXT", 0, null, 0], [3, "bulgarian_commander", "TEXT", 0, null, 0], [4, "latin_commander", "TEXT", 0, null, 0], [5, "result", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "ship": {"columns": [[0, "lost_in_battle", "INT", 0, null, 0], [1, "id", "INT", 0, null, 1], [2, "name", "TEXT", 0, null, 0], [3, "tonnage", "TEXT", 0, null, 0], [4, "ship_type", "TEXT", 0, null, 0], [5, "location", "TEXT", 0, null, 0], [6, "disposition_of_ship", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "battle", "lost_in_battle", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "id"]]], "check_constraints": []}, "death": {"columns": [[0, "caused_by_ship_id", "INT", 0, null, 0], [1, "id", "INT", 0, null, 1], [2, "note", "TEXT", 0, null, 0], [3, "killed", "INT", 0, null, 0], [4, "injured", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "ship", "caused_by_ship_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "id"]]], "check_constraints": []}}
CREATE TABLE battle (
    id INT   PRIMARY KEY,
    name TEXT,
    date TEXT,
    bulgarian_commander TEXT,
    latin_commander TEXT,
    result TEXT,
    UNIQUE (id)
);

CREATE TABLE ship (
    lost_in_battle INT,
    id INT   PRIMARY KEY,
    name TEXT,
    tonnage TEXT,
    ship_type TEXT,
    location TEXT,
    disposition_of_ship TEXT,
    UNIQUE (id),
    FOREIGN KEY (lost_in_battle) REFERENCES battle(id)
);

CREATE TABLE death (
    caused_by_ship_id INT,
    id INT   PRIMARY KEY,
    note TEXT,
    killed INT,
    injured INT,
    UNIQUE (id),
    FOREIGN KEY (caused_by_ship_id) REFERENCES ship(id)
);