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

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

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



INSERT INTO "Patient" VALUES ("1", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "F", "No Thrombosis");
INSERT INTO "Patient" VALUES ("3", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("4", "F", "No Thrombosis");
INSERT INTO "Patient" VALUES ("5", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("6", "F", "No Thrombosis");
INSERT INTO "Patient" VALUES ("7", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("8", "F", "No Thrombosis");
INSERT INTO "Patient" VALUES ("9", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("10", "F", "No Thrombosis");
INSERT INTO "Patient" VALUES ("11", "M", "Thrombosis");
INSERT INTO "Patient" VALUES ("12", "F", "No Thrombosis");
INSERT INTO "Examination" VALUES ("1", "Deep Vein Thrombosis", "Leg swelling, Pain", "1");
INSERT INTO "Examination" VALUES ("2", "No Thrombosis", "NULL", "0");
INSERT INTO "Examination" VALUES ("3", "Pulmonary Embolism", "Shortness of breath", "1");
INSERT INTO "Examination" VALUES ("4", "No Thrombosis", "Headache", "0");
INSERT INTO "Examination" VALUES ("5", "Deep Vein Thrombosis", "Redness, Warmth", "1");
INSERT INTO "Examination" VALUES ("6", "No Thrombosis", "NULL", "0");
INSERT INTO "Examination" VALUES ("7", "Pulmonary Embolism", "Chest pain", "1");
INSERT INTO "Examination" VALUES ("8", "No Thrombosis", "Fatigue", "0");
INSERT INTO "Examination" VALUES ("9", "Deep Vein Thrombosis", "Calf tenderness", "1");
INSERT INTO "Examination" VALUES ("10", "No Thrombosis", "NULL", "0");
INSERT INTO "Examination" VALUES ("11", "Pulmonary Embolism", "Cough", "1");
INSERT INTO "Examination" VALUES ("12", "No Thrombosis", "Dizziness", "0");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "150");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-20", "450");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-01", "200");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-10", "350");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-12", "80");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-05", "120");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-20", "180");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-25", "380");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-11", "250");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-01", "90");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-14", "300");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-03", "110");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-22", "420");
INSERT INTO "Laboratory" VALUES ("11", "2023-11-07", "160");
INSERT INTO "Laboratory" VALUES ("12", "2023-12-01", "220");