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,
"LDH" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "1980-05-10");
INSERT INTO "Patient" VALUES ("2", "1995-11-22");
INSERT INTO "Patient" VALUES ("3", "1970-01-15");
INSERT INTO "Patient" VALUES ("4", "2000-03-01");
INSERT INTO "Patient" VALUES ("5", "1965-07-30");
INSERT INTO "Patient" VALUES ("6", "1992-09-18");
INSERT INTO "Patient" VALUES ("7", "1988-02-29");
INSERT INTO "Patient" VALUES ("8", "1975-04-05");
INSERT INTO "Patient" VALUES ("9", "2005-12-12");
INSERT INTO "Patient" VALUES ("10", "1950-06-25");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-01", "550");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "650");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-01", "720");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-10", "810");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-05", "590");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-20", "600");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-01", "799");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-11", "450");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-01", "680");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-15", "750");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-01", "800");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-20", "700");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-10", "500");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-20", "620");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-15", "780");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-25", "850");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-10", "580");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-20", "610");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-10", "710");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-20", "550");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-10", "690");