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

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"PLT" INT,
"PT" FLOAT,
"APTT" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "Cough");
INSERT INTO "Patient" VALUES ("2", "NULL");
INSERT INTO "Patient" VALUES ("3", "Fever");
INSERT INTO "Patient" VALUES ("4", "Headache");
INSERT INTO "Patient" VALUES ("5", "NULL");
INSERT INTO "Patient" VALUES ("6", "Fatigue");
INSERT INTO "Patient" VALUES ("7", "NULL");
INSERT INTO "Patient" VALUES ("8", "Nausea");
INSERT INTO "Patient" VALUES ("9", "NULL");
INSERT INTO "Patient" VALUES ("10", "Dizziness");
INSERT INTO "Examination" VALUES ("1", "Positive", "1");
INSERT INTO "Examination" VALUES ("2", "NULL", "0");
INSERT INTO "Examination" VALUES ("3", "Negative", "0");
INSERT INTO "Examination" VALUES ("4", "Positive", "1");
INSERT INTO "Examination" VALUES ("5", "NULL", "0");
INSERT INTO "Examination" VALUES ("6", "Negative", "0");
INSERT INTO "Examination" VALUES ("7", "NULL", "0");
INSERT INTO "Examination" VALUES ("8", "Positive", "1");
INSERT INTO "Examination" VALUES ("9", "NULL", "0");
INSERT INTO "Examination" VALUES ("10", "Negative", "0");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "150", "12.5", "30");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-11", "90", "13.0", "28");
INSERT INTO "Laboratory" VALUES ("3", "2024-01-12", "350", "11.8", "32");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-13", "101", "12.0", "29");
INSERT INTO "Laboratory" VALUES ("5", "2024-01-14", "400", "12.7", "31");
INSERT INTO "Laboratory" VALUES ("6", "2024-01-15", "250", "13.2", "27");
INSERT INTO "Laboratory" VALUES ("7", "2024-01-16", "100", "12.3", "30");
INSERT INTO "Laboratory" VALUES ("8", "2024-01-17", "399", "11.9", "33");
INSERT INTO "Laboratory" VALUES ("9", "2024-01-18", "50", "12.1", "29");
INSERT INTO "Laboratory" VALUES ("10", "2024-01-19", "200", "12.4", "28");