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,
"SEX" TEXT,
"Birthday" 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-02-15");
INSERT INTO "Laboratory" VALUES ("2", "2023-03-05");
INSERT INTO "Laboratory" VALUES ("3", "2023-04-01");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-25");
INSERT INTO "Laboratory" VALUES ("5", "2023-06-08");
INSERT INTO "Laboratory" VALUES ("6", "2023-07-20");
INSERT INTO "Laboratory" VALUES ("7", "2023-08-25");
INSERT INTO "Laboratory" VALUES ("8", "2023-09-15");
INSERT INTO "Laboratory" VALUES ("9", "2023-10-03");
INSERT INTO "Patient" VALUES ("1", "F", "1925-05-10");
INSERT INTO "Patient" VALUES ("2", "M", "1980-11-22");
INSERT INTO "Patient" VALUES ("3", "F", "1995-03-15");
INSERT INTO "Patient" VALUES ("4", "F", "1935-07-01");
INSERT INTO "Patient" VALUES ("5", "M", "1960-01-01");
INSERT INTO "Patient" VALUES ("6", "F", "2000-09-30");
INSERT INTO "Patient" VALUES ("7", "M", "1972-04-18");
INSERT INTO "Patient" VALUES ("8", "F", "1940-12-25");
INSERT INTO "Patient" VALUES ("9", "F", "1988-06-05");
INSERT INTO "Patient" VALUES ("10", "M", "1955-02-14");
INSERT INTO "Patient" VALUES ("11", "F", "1929-08-01");
INSERT INTO "Patient" VALUES ("12", "F", "1930-01-01");
INSERT INTO "Patient" VALUES ("13", "F", "1931-01-01");
INSERT INTO "Patient" VALUES ("14", "M", "1930-12-31");
INSERT INTO "Patient" VALUES ("15", "F", "1930-12-31");