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,
"Birthday" DATE,
"Admission" TEXT,
"Diagnosis" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Examination" VALUES ("Thrombosis");
INSERT INTO "Examination" VALUES ("No Thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-20");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-10");
INSERT INTO "Patient" VALUES ("101", "F", "1964-05-12", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("102", "F", "1964-11-30", "+", "No Thrombosis");
INSERT INTO "Patient" VALUES ("103", "F", "1964-07-01", "-", "Thrombosis");
INSERT INTO "Patient" VALUES ("104", "M", "1964-03-22", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("105", "F", "1963-12-15", "+", "No Thrombosis");
INSERT INTO "Patient" VALUES ("106", "F", "1964-01-05", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("107", "F", "1965-06-18", "+", "No Thrombosis");
INSERT INTO "Patient" VALUES ("108", "F", "1964-09-09", "-", "No Thrombosis");
INSERT INTO "Patient" VALUES ("109", "M", "1964-08-20", "-", "No Thrombosis");
INSERT INTO "Patient" VALUES ("110", "F", "1964-12-31", "+", "Thrombosis");