PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "battle" (
"id" INT,
"result" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "death" (
"id" INT,
"killed" INT,
"injured" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "ship" (
"lost_in_battle" INT,
"id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("lost_in_battle") REFERENCES "battle"("id")
);





INSERT INTO "battle" VALUES ("1", "victory");
INSERT INTO "battle" VALUES ("2", "defeat");
INSERT INTO "battle" VALUES ("3", "draw");
INSERT INTO "battle" VALUES ("4", "victory");
INSERT INTO "battle" VALUES ("5", "defeat");
INSERT INTO "battle" VALUES ("6", "victory");
INSERT INTO "battle" VALUES ("7", "draw");
INSERT INTO "death" VALUES ("1", "100", "50");
INSERT INTO "death" VALUES ("2", "200", "150");
INSERT INTO "death" VALUES ("3", "50", "20");
INSERT INTO "death" VALUES ("4", "300", "250");
INSERT INTO "death" VALUES ("5", "120", "80");
INSERT INTO "death" VALUES ("6", "180", "100");
INSERT INTO "death" VALUES ("7", "70", "30");
INSERT INTO "ship" VALUES ("1", "101");
INSERT INTO "ship" VALUES ("2", "102");
INSERT INTO "ship" VALUES ("2", "103");
INSERT INTO "ship" VALUES ("3", "104");
INSERT INTO "ship" VALUES ("4", "105");
INSERT INTO "ship" VALUES ("5", "106");
INSERT INTO "ship" VALUES ("5", "107");
INSERT INTO "ship" VALUES ("5", "108");
INSERT INTO "ship" VALUES ("6", "109");
INSERT INTO "ship" VALUES ("7", "110");