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,
"Thrombosis" INT
);

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

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



INSERT INTO "Examination" VALUES ("SLE", "1");
INSERT INTO "Examination" VALUES ("SLE", "0");
INSERT INTO "Examination" VALUES ("Thrombosis", "1");
INSERT INTO "Examination" VALUES ("Other", "0");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "5.2");
INSERT INTO "Laboratory" VALUES ("1", "2024-02-15", "3.1");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-12", "7.0");
INSERT INTO "Laboratory" VALUES ("3", "2024-03-01", "2.5");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-20", "4.0");
INSERT INTO "Laboratory" VALUES ("5", "2024-02-25", "6.3");
INSERT INTO "Laboratory" VALUES ("6", "2024-03-10", "1.8");
INSERT INTO "Laboratory" VALUES ("7", "2024-03-15", "0.9");
INSERT INTO "Patient" VALUES ("1", "+", "SLE");
INSERT INTO "Patient" VALUES ("2", "-", "SLE");
INSERT INTO "Patient" VALUES ("3", "+", "SLE");
INSERT INTO "Patient" VALUES ("4", "-", "SLE");
INSERT INTO "Patient" VALUES ("5", "-", "SLE");
INSERT INTO "Patient" VALUES ("6", "+", "Other");
INSERT INTO "Patient" VALUES ("7", "-", "Other");
INSERT INTO "Patient" VALUES ("8", "+", "SLE");
INSERT INTO "Patient" VALUES ("9", "-", "SLE");
INSERT INTO "Patient" VALUES ("10", "+", "Thrombosis");