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

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
PRIMARY KEY ("ID", "Date")
);

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



INSERT INTO "Examination" VALUES ("2023-01-15", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-02-20", "No Thrombosis");
INSERT INTO "Examination" VALUES ("2023-03-10", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-04-05", "No Thrombosis");
INSERT INTO "Examination" VALUES ("2023-05-01", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-06-12", "No Thrombosis");
INSERT INTO "Examination" VALUES ("2023-07-25", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-08-30", "No Thrombosis");
INSERT INTO "Examination" VALUES ("2023-09-18", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-10-07", "No Thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-12");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-18");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-08");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-03");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-29");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-10");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-23");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-28");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-16");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-05");
INSERT INTO "Patient" VALUES ("1", "1990-05-10", "2020-01-01");
INSERT INTO "Patient" VALUES ("2", "2000-01-01", "2020-01-01");
INSERT INTO "Patient" VALUES ("3", "1985-11-20", "2019-06-15");
INSERT INTO "Patient" VALUES ("4", "1995-03-15", "2021-02-20");
INSERT INTO "Patient" VALUES ("5", "2005-07-01", "2022-09-10");
INSERT INTO "Patient" VALUES ("6", "1970-02-28", "2018-03-05");
INSERT INTO "Patient" VALUES ("7", "1998-09-09", "2020-11-11");
INSERT INTO "Patient" VALUES ("8", "2002-04-25", "2023-01-01");
INSERT INTO "Patient" VALUES ("9", "1980-12-12", "2017-07-07");
INSERT INTO "Patient" VALUES ("10", "2003-06-30", "2023-06-30");
INSERT INTO "Patient" VALUES ("11", "2003-06-29", "2023-06-30");
INSERT INTO "Patient" VALUES ("12", "2003-07-01", "2023-06-30");
INSERT INTO "Patient" VALUES ("13", "2003-06-30", "2024-06-30");
INSERT INTO "Patient" VALUES ("14", "2003-06-30", "2022-06-30");