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,
"HGB" FLOAT,
"HCT" FLOAT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "M", "1970-05-20");
INSERT INTO "Patient" VALUES ("2", "F", "1985-11-15");
INSERT INTO "Patient" VALUES ("3", "M", "1990-01-30");
INSERT INTO "Patient" VALUES ("4", "F", "2000-07-10");
INSERT INTO "Patient" VALUES ("5", "M", "1960-12-05");
INSERT INTO "Patient" VALUES ("6", "F", "1975-03-25");
INSERT INTO "Patient" VALUES ("7", "M", "1988-09-12");
INSERT INTO "Patient" VALUES ("8", "F", "1995-06-18");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "14.2", "53.0");
INSERT INTO "Laboratory" VALUES ("1", "2023-03-15", "13.8", "52.5");
INSERT INTO "Laboratory" VALUES ("1", "2023-06-20", "14.0", "51.9");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-05", "13.5", "51.8");
INSERT INTO "Laboratory" VALUES ("2", "2023-04-10", "13.7", "52.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-07-15", "13.9", "52.1");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-25", "14.1", "50.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-05-30", "14.3", "51.5");
INSERT INTO "Laboratory" VALUES ("4", "2023-03-12", "13.6", "52.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-06-18", "13.8", "52.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-05", "14.5", "53.5");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-10", "14.7", "54.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-07-20", "14.6", "54.2");
INSERT INTO "Laboratory" VALUES ("6", "2023-02-15", "13.4", "51.9");
INSERT INTO "Laboratory" VALUES ("6", "2023-05-20", "13.5", "51.8");
INSERT INTO "Laboratory" VALUES ("7", "2023-03-10", "14.0", "52.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-06-15", "14.1", "52.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-09-20", "14.2", "52.1");
INSERT INTO "Laboratory" VALUES ("8", "2023-04-05", "13.7", "50.5");
INSERT INTO "Laboratory" VALUES ("8", "2023-07-10", "13.8", "51.0");