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 UNIQUE,
"name" TEXT,
"bulgarian_commander" TEXT,
"latin_commander" TEXT,
"result" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "death" (
"id" INT,
"killed" 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", "Battle of Adrianople", "Kaloyan", "Louis I", "Bulgarian victory");
INSERT INTO "battle" VALUES ("2", "Battle of Philippopolis", "Boril", "Henry of Flanders", "Latin victory");
INSERT INTO "battle" VALUES ("3", "Battle of Beroia", "Ivan Asen II", "Theodore Komnenos Doukas", "Bulgarian victory");
INSERT INTO "battle" VALUES ("4", "Battle of Klokotnitsa", "Ivan Asen II", "Theodore Komnenos Doukas", "Bulgarian victory");
INSERT INTO "battle" VALUES ("5", "Battle of Pernik", "Georgi Terter I", "Michael VIII Palaiologos", "Bulgarian victory");
INSERT INTO "battle" VALUES ("6", "Battle of Sredets", "Boril", "Baldwin I", "Bulgarian victory");
INSERT INTO "battle" VALUES ("7", "Battle of Varna", "Vladislav III", "Murad II", "Ottoman victory");
INSERT INTO "battle" VALUES ("8", "Battle of Nicopolis", "Ivan Shishman", "Sigismund of Luxembourg", "Ottoman victory");
INSERT INTO "battle" VALUES ("9", "Battle of Maritsa", "Vukašin Mrnjavčević", "Lala Şahin Pasha", "Ottoman victory");
INSERT INTO "battle" VALUES ("10", "Battle of Chernomen", "Vukašin Mrnjavčević", "Lala Şahin Pasha", "Ottoman victory");
INSERT INTO "death" VALUES ("1", "15000");
INSERT INTO "death" VALUES ("2", "10000");
INSERT INTO "death" VALUES ("3", "5000");
INSERT INTO "death" VALUES ("4", "2000");
INSERT INTO "death" VALUES ("5", "1000");
INSERT INTO "death" VALUES ("6", "7000");
INSERT INTO "death" VALUES ("7", "30000");
INSERT INTO "death" VALUES ("8", "10000");
INSERT INTO "death" VALUES ("9", "70000");
INSERT INTO "death" VALUES ("10", "60000");
INSERT INTO "ship" VALUES ("1", "101");
INSERT INTO "ship" VALUES ("1", "102");
INSERT INTO "ship" VALUES ("2", "201");
INSERT INTO "ship" VALUES ("3", "301");
INSERT INTO "ship" VALUES ("4", "401");
INSERT INTO "ship" VALUES ("5", "501");
INSERT INTO "ship" VALUES ("7", "701");
INSERT INTO "ship" VALUES ("7", "702");
INSERT INTO "ship" VALUES ("8", "801");
INSERT INTO "ship" VALUES ("9", "901");