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

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

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



INSERT INTO "Patient" VALUES ("1");
INSERT INTO "Patient" VALUES ("2");
INSERT INTO "Patient" VALUES ("3");
INSERT INTO "Patient" VALUES ("4");
INSERT INTO "Patient" VALUES ("5");
INSERT INTO "Laboratory" VALUES ("1", "1991-01-15", "4.5", "13.0", "28.5");
INSERT INTO "Laboratory" VALUES ("1", "1991-06-20", "4.7", "14.2", "30.0");
INSERT INTO "Laboratory" VALUES ("2", "1991-03-10", "4.2", "12.5", "27.0");
INSERT INTO "Laboratory" VALUES ("2", "1991-11-05", "4.3", "12.8", "28.0");
INSERT INTO "Laboratory" VALUES ("3", "1991-07-22", "4.8", "15.0", "31.5");
INSERT INTO "Laboratory" VALUES ("3", "1990-12-30", "4.6", "14.0", "29.5");
INSERT INTO "Laboratory" VALUES ("4", "1991-09-15", "4.1", "11.5", "25.5");
INSERT INTO "Laboratory" VALUES ("4", "1991-10-10", "4.0", "11.0", "28.9");
INSERT INTO "Laboratory" VALUES ("5", "1992-01-01", "4.4", "13.5", "27.5");
INSERT INTO "Laboratory" VALUES ("5", "1991-04-18", "4.5", "13.8", "28.8");