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 "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,
"Diagnosis" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "Healthy");
INSERT INTO "Patient" VALUES ("2", "Thrombosis");
INSERT INTO "Patient" VALUES ("3", "Healthy");
INSERT INTO "Patient" VALUES ("4", "Thrombosis");
INSERT INTO "Patient" VALUES ("5", "Healthy");
INSERT INTO "Patient" VALUES ("6", "Thrombosis");
INSERT INTO "Patient" VALUES ("7", "Healthy");
INSERT INTO "Patient" VALUES ("8", "Thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-01", "1999", "150", "300");
INSERT INTO "Laboratory" VALUES ("1", "2024-02-01", "2000", "160", "310");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-15", "2500", "140", "290");
INSERT INTO "Laboratory" VALUES ("2", "2024-03-01", "1800", "130", "280");
INSERT INTO "Laboratory" VALUES ("3", "2024-01-20", "2100", "120", "270");
INSERT INTO "Laboratory" VALUES ("4", "2024-02-10", "1998", "110", "260");
INSERT INTO "Laboratory" VALUES ("5", "2024-03-05", "2200", "100", "250");
INSERT INTO "Laboratory" VALUES ("6", "2024-01-25", "1997", "90", "240");
INSERT INTO "Laboratory" VALUES ("7", "2024-02-15", "2001", "80", "230");
INSERT INTO "Laboratory" VALUES ("8", "2024-03-10", "1500", "70", "220");
INSERT INTO "Laboratory" VALUES ("8", "2024-04-10", "2100", "60", "210");