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 "Examination" (
"Diagnosis" TEXT
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"IGG" INT,
"IGA" INT,
"IGM" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
PRIMARY KEY ("ID")
);



INSERT INTO "Examination" VALUES ("Thrombosis");
INSERT INTO "Examination" VALUES ("No Thrombosis");
INSERT INTO "Examination" VALUES ("Deep Vein Thrombosis");
INSERT INTO "Examination" VALUES ("Pulmonary Embolism");
INSERT INTO "Examination" VALUES ("Myocardial Infarction");
INSERT INTO "Patient" VALUES ("1");
INSERT INTO "Patient" VALUES ("2");
INSERT INTO "Patient" VALUES ("3");
INSERT INTO "Patient" VALUES ("4");
INSERT INTO "Patient" VALUES ("5");
INSERT INTO "Patient" VALUES ("6");
INSERT INTO "Patient" VALUES ("7");
INSERT INTO "Patient" VALUES ("8");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "2100", "150", "100");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-01", "1800", "160", "110");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-20", "2050", "140", "90");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-25", "1900", "130", "80");
INSERT INTO "Laboratory" VALUES ("4", "2023-02-05", "2200", "170", "120");
INSERT INTO "Laboratory" VALUES ("4", "2023-02-10", "2000", "175", "125");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-15", "1950", "155", "95");
INSERT INTO "Laboratory" VALUES ("6", "2023-02-20", "2300", "180", "130");
INSERT INTO "Laboratory" VALUES ("7", "2023-02-25", "1999", "165", "105");
INSERT INTO "Laboratory" VALUES ("8", "2023-03-01", "2000", "145", "85");