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

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

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
"SEX" TEXT,
"Admission" TEXT,
"Diagnosis" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Examination" VALUES ("DVT");
INSERT INTO "Examination" VALUES ("PE");
INSERT INTO "Examination" VALUES ("No thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-11");
INSERT INTO "Laboratory" VALUES ("3", "2024-01-12");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-13");
INSERT INTO "Laboratory" VALUES ("5", "2024-01-14");
INSERT INTO "Patient" VALUES ("1", "M", "+", "DVT");
INSERT INTO "Patient" VALUES ("2", "M", "+", "PE");
INSERT INTO "Patient" VALUES ("3", "M", "+", "No thrombosis");
INSERT INTO "Patient" VALUES ("4", "M", "+", "DVT");
INSERT INTO "Patient" VALUES ("5", "M", "-", "PE");
INSERT INTO "Patient" VALUES ("6", "M", "-", "No thrombosis");
INSERT INTO "Patient" VALUES ("7", "M", "-", "DVT");
INSERT INTO "Patient" VALUES ("8", "M", "-", "PE");
INSERT INTO "Patient" VALUES ("9", "F", "+", "DVT");
INSERT INTO "Patient" VALUES ("10", "F", "-", "No thrombosis");
INSERT INTO "Patient" VALUES ("11", "F", "+", "PE");
INSERT INTO "Patient" VALUES ("12", "F", "-", "DVT");
INSERT INTO "Patient" VALUES ("13", "M", "+", "PE");
INSERT INTO "Patient" VALUES ("14", "M", "+", "No thrombosis");
INSERT INTO "Patient" VALUES ("15", "M", "-", "No thrombosis");
INSERT INTO "Patient" VALUES ("16", "M", "-", "PE");
INSERT INTO "Patient" VALUES ("17", "M", "-", "DVT");
INSERT INTO "Patient" VALUES ("18", "M", "+", "DVT");
INSERT INTO "Patient" VALUES ("19", "M", "+", "PE");
INSERT INTO "Patient" VALUES ("20", "M", "-", "No thrombosis");