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" (
"Examination Date" DATE,
"LAC" TEXT
);

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

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



INSERT INTO "Patient" VALUES ("1", "1993-01-15", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "1991-05-20", "Anemia");
INSERT INTO "Patient" VALUES ("3", "1994-03-10", "Healthy");
INSERT INTO "Patient" VALUES ("4", "1993-11-01", "Thrombosis");
INSERT INTO "Patient" VALUES ("5", "1995-07-22", "Healthy");
INSERT INTO "Patient" VALUES ("6", "1992-12-31", "Thrombosis");
INSERT INTO "Patient" VALUES ("7", "1993-02-28", "Anemia");
INSERT INTO "Laboratory" VALUES ("1", "1993-01-15", "12.5");
INSERT INTO "Laboratory" VALUES ("1", "1993-02-01", "15.0");
INSERT INTO "Laboratory" VALUES ("2", "1991-05-20", "11.8");
INSERT INTO "Laboratory" VALUES ("3", "1994-03-10", "13.2");
INSERT INTO "Laboratory" VALUES ("3", "1994-04-01", "14.5");
INSERT INTO "Laboratory" VALUES ("4", "1993-11-01", "10.9");
INSERT INTO "Laboratory" VALUES ("4", "1993-12-01", "16.0");
INSERT INTO "Laboratory" VALUES ("5", "1995-07-22", "12.0");
INSERT INTO "Laboratory" VALUES ("6", "1992-12-31", "13.5");
INSERT INTO "Laboratory" VALUES ("7", "1993-02-28", "11.5");
INSERT INTO "Laboratory" VALUES ("7", "1993-03-15", "14.2");
INSERT INTO "Examination" VALUES ("1993-01-15", "Positive");
INSERT INTO "Examination" VALUES ("1991-05-20", "Negative");
INSERT INTO "Examination" VALUES ("1994-03-10", "Negative");
INSERT INTO "Examination" VALUES ("1993-11-01", "Positive");
INSERT INTO "Examination" VALUES ("1995-07-22", "Negative");
INSERT INTO "Examination" VALUES ("1992-12-31", "Positive");
INSERT INTO "Examination" VALUES ("1993-02-28", "Negative");