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,
PRIMARY KEY ("id")
);

CREATE TABLE "death" (
"caused_by_ship_id" INT,
"id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("caused_by_ship_id") REFERENCES "ship"("id")
);

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





INSERT INTO "battle" VALUES ("1", "Battle of Midway");
INSERT INTO "battle" VALUES ("2", "Battle of the Atlantic");
INSERT INTO "battle" VALUES ("3", "Battle of Leyte Gulf");
INSERT INTO "battle" VALUES ("4", "Battle of Jutland");
INSERT INTO "battle" VALUES ("5", "Battle of Trafalgar");
INSERT INTO "battle" VALUES ("6", "Battle of Tsushima");
INSERT INTO "battle" VALUES ("7", "Battle of the Coral Sea");
INSERT INTO "battle" VALUES ("8", "Battle of the Philippine Sea");
INSERT INTO "battle" VALUES ("9", "Battle of Cape Matapan");
INSERT INTO "battle" VALUES ("10", "Battle of the River Plate");
INSERT INTO "ship" VALUES ("1", "101", "USS Yorktown", "19800");
INSERT INTO "ship" VALUES ("1", "102", "IJN Akagi", "36500");
INSERT INTO "ship" VALUES ("2", "103", "HMS Hood", "42100");
INSERT INTO "ship" VALUES ("2", "104", "Bismarck", "41700");
INSERT INTO "ship" VALUES ("3", "105", "USS Princeton", "11000");
INSERT INTO "ship" VALUES ("3", "106", "IJN Musashi", "72800");
INSERT INTO "ship" VALUES ("4", "107", "HMS Invincible", "17250");
INSERT INTO "ship" VALUES ("4", "108", "SMS Lützow", "26700");
INSERT INTO "ship" VALUES ("5", "109", "HMS Victory", "3500");
INSERT INTO "ship" VALUES ("5", "110", "Bucentaure", "225");
INSERT INTO "ship" VALUES ("6", "111", "Knyaz Suvorov", "14400");
INSERT INTO "ship" VALUES ("6", "112", "Mikasa", "15140");
INSERT INTO "ship" VALUES ("7", "113", "USS Lexington", "36000");
INSERT INTO "ship" VALUES ("7", "114", "Shoho", "11200");
INSERT INTO "ship" VALUES ("8", "115", "USS Wasp", "14700");
INSERT INTO "ship" VALUES ("8", "116", "Taiho", "31000");
INSERT INTO "ship" VALUES ("9", "117", "HMS Gloucester", "9400");
INSERT INTO "ship" VALUES ("9", "118", "Zara", "11870");
INSERT INTO "ship" VALUES ("10", "119", "HMS Exeter", "8390");
INSERT INTO "ship" VALUES ("10", "120", "Admiral Graf Spee", "16200");
INSERT INTO "ship" VALUES ("1", "121", "USS Hammann", "225");
INSERT INTO "ship" VALUES ("2", "122", "U-47", "225");
INSERT INTO "ship" VALUES ("3", "123", "USS Gambier Bay", "225");
INSERT INTO "ship" VALUES ("4", "124", "HMS Queen Mary", "225");
INSERT INTO "ship" VALUES ("5", "125", "Redoutable", "225");
INSERT INTO "ship" VALUES ("6", "126", "Oslyabya", "225");
INSERT INTO "ship" VALUES ("7", "127", "USS Neosho", "225");
INSERT INTO "ship" VALUES ("8", "128", "USS Indianapolis", "225");
INSERT INTO "ship" VALUES ("9", "129", "HMS Neptune", "225");
INSERT INTO "ship" VALUES ("10", "130", "HMS Achilles", "225");
INSERT INTO "ship" VALUES ("NULL", "131", "USS Enterprise", "36000");
INSERT INTO "ship" VALUES ("NULL", "132", "HMS Warspite", "31000");
INSERT INTO "ship" VALUES ("NULL", "133", "USS Missouri", "45000");
INSERT INTO "ship" VALUES ("NULL", "134", "IJN Yamato", "72800");
INSERT INTO "ship" VALUES ("NULL", "135", "HMS Belfast", "11500");
INSERT INTO "ship" VALUES ("NULL", "136", "USS Arizona", "32600");
INSERT INTO "ship" VALUES ("NULL", "137", "USS Hornet", "29100");
INSERT INTO "ship" VALUES ("NULL", "138", "IJN Kaga", "38250");
INSERT INTO "ship" VALUES ("NULL", "139", "HMS Prince of Wales", "35000");
INSERT INTO "ship" VALUES ("NULL", "140", "Bismarck", "41700");
INSERT INTO "death" VALUES ("101", "1");
INSERT INTO "death" VALUES ("102", "2");
INSERT INTO "death" VALUES ("103", "3");
INSERT INTO "death" VALUES ("104", "4");
INSERT INTO "death" VALUES ("105", "5");
INSERT INTO "death" VALUES ("106", "6");
INSERT INTO "death" VALUES ("107", "7");
INSERT INTO "death" VALUES ("108", "8");
INSERT INTO "death" VALUES ("109", "9");
INSERT INTO "death" VALUES ("110", "10");
INSERT INTO "death" VALUES ("111", "11");
INSERT INTO "death" VALUES ("112", "12");
INSERT INTO "death" VALUES ("113", "13");
INSERT INTO "death" VALUES ("114", "14");
INSERT INTO "death" VALUES ("115", "15");
INSERT INTO "death" VALUES ("116", "16");
INSERT INTO "death" VALUES ("117", "17");
INSERT INTO "death" VALUES ("118", "18");
INSERT INTO "death" VALUES ("119", "19");
INSERT INTO "death" VALUES ("120", "20");
INSERT INTO "death" VALUES ("121", "21");
INSERT INTO "death" VALUES ("122", "22");
INSERT INTO "death" VALUES ("123", "23");
INSERT INTO "death" VALUES ("124", "24");
INSERT INTO "death" VALUES ("125", "25");
INSERT INTO "death" VALUES ("126", "26");
INSERT INTO "death" VALUES ("127", "27");
INSERT INTO "death" VALUES ("128", "28");
INSERT INTO "death" VALUES ("129", "29");
INSERT INTO "death" VALUES ("130", "30");