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" (
"Examination Date" DATE
);

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

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



INSERT INTO "Examination" VALUES ("2023-01-15");
INSERT INTO "Examination" VALUES ("2023-02-20");
INSERT INTO "Examination" VALUES ("2023-03-10");
INSERT INTO "Examination" VALUES ("2023-04-05");
INSERT INTO "Examination" VALUES ("2023-05-12");
INSERT INTO "Examination" VALUES ("2023-06-01");
INSERT INTO "Examination" VALUES ("2023-07-08");
INSERT INTO "Examination" VALUES ("2023-08-25");
INSERT INTO "Examination" VALUES ("2023-09-18");
INSERT INTO "Examination" VALUES ("2023-10-30");
INSERT INTO "Patient" VALUES ("1", "1980-05-20", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "1992-11-10", "No Thrombosis");
INSERT INTO "Patient" VALUES ("3", "1975-03-01", "Thrombosis");
INSERT INTO "Patient" VALUES ("4", "2000-07-15", "No Thrombosis");
INSERT INTO "Patient" VALUES ("5", "1965-09-22", "Thrombosis");
INSERT INTO "Patient" VALUES ("6", "1988-01-05", "No Thrombosis");
INSERT INTO "Patient" VALUES ("7", "1995-04-18", "Thrombosis");
INSERT INTO "Patient" VALUES ("8", "1970-12-03", "No Thrombosis");
INSERT INTO "Patient" VALUES ("9", "1982-06-28", "Thrombosis");
INSERT INTO "Patient" VALUES ("10", "1990-02-14", "No Thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "450");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-15", "550");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-15", "300");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-20", "480");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-20", "600");
INSERT INTO "Laboratory" VALUES ("4", "2023-03-10", "250");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-05", "490");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-05", "520");
INSERT INTO "Laboratory" VALUES ("6", "2023-05-12", "380");
INSERT INTO "Laboratory" VALUES ("7", "2023-06-01", "420");
INSERT INTO "Laboratory" VALUES ("8", "2023-07-08", "310");
INSERT INTO "Laboratory" VALUES ("9", "2023-08-25", "470");
INSERT INTO "Laboratory" VALUES ("10", "2023-09-18", "290");
INSERT INTO "Laboratory" VALUES ("1", "2023-10-30", "460");
INSERT INTO "Laboratory" VALUES ("2", "2023-10-30", "510");
INSERT INTO "Laboratory" VALUES ("4", "2023-10-30", "400");