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,
"name" TEXT,
"bulgarian_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,
"name" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("lost_in_battle") REFERENCES "battle"("id")
);





INSERT INTO "battle" VALUES ("1", "Battle of Adrianople", "Boril", "Victory");
INSERT INTO "battle" VALUES ("2", "Battle of Klokotnitsa", "Ivan Asen II", "Decisive Victory");
INSERT INTO "battle" VALUES ("3", "Battle of Velbazhd", "Michael Shishman", "Defeat");
INSERT INTO "battle" VALUES ("4", "Battle of Kleidion", "Samuil", "Defeat");
INSERT INTO "battle" VALUES ("5", "Battle of Rusokastro", "Ivailo", "Victory");
INSERT INTO "battle" VALUES ("6", "Battle of Tryavna", "Boril", "Victory");
INSERT INTO "battle" VALUES ("7", "Battle of Pliska", "Krum", "Victory");
INSERT INTO "death" VALUES ("1", "15000");
INSERT INTO "death" VALUES ("2", "20000");
INSERT INTO "death" VALUES ("3", "12000");
INSERT INTO "death" VALUES ("4", "25000");
INSERT INTO "death" VALUES ("5", "8000");
INSERT INTO "death" VALUES ("6", "10000");
INSERT INTO "death" VALUES ("7", "18000");
INSERT INTO "ship" VALUES ("1", "1", "Warship A");
INSERT INTO "ship" VALUES ("0", "2", "Warship B");
INSERT INTO "ship" VALUES ("3", "3", "Warship C");
INSERT INTO "ship" VALUES ("0", "4", "Warship D");
INSERT INTO "ship" VALUES ("5", "5", "Warship E");
INSERT INTO "ship" VALUES ("0", "6", "Warship F");
INSERT INTO "ship" VALUES ("7", "7", "Warship G");