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" (
"LAC" TEXT
);

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

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



INSERT INTO "Patient" VALUES ("1", "M");
INSERT INTO "Patient" VALUES ("2", "F");
INSERT INTO "Patient" VALUES ("3", "M");
INSERT INTO "Patient" VALUES ("4", "M");
INSERT INTO "Patient" VALUES ("5", "F");
INSERT INTO "Patient" VALUES ("6", "M");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "13.5", "30", "2.5");
INSERT INTO "Laboratory" VALUES ("1", "2024-02-15", "14.2", "28", "2.7");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-12", "15.0", "32", "2.6");
INSERT INTO "Laboratory" VALUES ("3", "2024-03-01", "12.8", "29", "2.4");
INSERT INTO "Laboratory" VALUES ("3", "2024-03-15", "13.9", "31", "2.3");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-20", "14.0", "27", "2.8");
INSERT INTO "Laboratory" VALUES ("4", "2024-02-20", "13.0", "26", "2.9");
INSERT INTO "Laboratory" VALUES ("5", "2024-01-25", "13.7", "30", "2.5");
INSERT INTO "Laboratory" VALUES ("6", "2024-02-10", "14.5", "33", "2.7");
INSERT INTO "Laboratory" VALUES ("6", "2024-02-25", "13.2", "34", "2.6");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");