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" (
"ID" INT,
"Thrombosis" INT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"PT" FLOAT,
"RA" TEXT,
"RF" TEXT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "Healthy");
INSERT INTO "Patient" VALUES ("2", "At risk");
INSERT INTO "Patient" VALUES ("3", "Recovered");
INSERT INTO "Patient" VALUES ("4", "Under observation");
INSERT INTO "Patient" VALUES ("5", "Healthy");
INSERT INTO "Patient" VALUES ("6", "At risk");
INSERT INTO "Patient" VALUES ("7", "Recovered");
INSERT INTO "Patient" VALUES ("8", "Under observation");
INSERT INTO "Patient" VALUES ("9", "Healthy");
INSERT INTO "Patient" VALUES ("10", "At risk");
INSERT INTO "Examination" VALUES ("1", "0");
INSERT INTO "Examination" VALUES ("2", "1");
INSERT INTO "Examination" VALUES ("3", "0");
INSERT INTO "Examination" VALUES ("4", "1");
INSERT INTO "Examination" VALUES ("5", "0");
INSERT INTO "Examination" VALUES ("6", "0");
INSERT INTO "Examination" VALUES ("7", "1");
INSERT INTO "Examination" VALUES ("8", "0");
INSERT INTO "Examination" VALUES ("9", "0");
INSERT INTO "Examination" VALUES ("10", "1");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "12.5", "Normal", "15");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-11", "14.0", "Elevated", "25");
INSERT INTO "Laboratory" VALUES ("3", "2024-01-12", "11.0", "Normal", "10");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-13", "13.5", "Elevated", "30");
INSERT INTO "Laboratory" VALUES ("5", "2024-01-14", "12.0", "Normal", "19");
INSERT INTO "Laboratory" VALUES ("6", "2024-01-15", "10.5", "Normal", "5");
INSERT INTO "Laboratory" VALUES ("7", "2024-01-16", "15.0", "Elevated", "22");
INSERT INTO "Laboratory" VALUES ("8", "2024-01-17", "11.5", "Normal", "18");
INSERT INTO "Laboratory" VALUES ("9", "2024-01-18", "12.8", "Normal", "0");
INSERT INTO "Laboratory" VALUES ("10", "2024-01-19", "14.2", "Elevated", "35");