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
);

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,
"Birthday" DATE,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "1980-05-10");
INSERT INTO "Patient" VALUES ("2", "1992-11-22");
INSERT INTO "Patient" VALUES ("3", "1975-03-15");
INSERT INTO "Patient" VALUES ("4", "2000-01-01");
INSERT INTO "Patient" VALUES ("5", "1965-07-30");
INSERT INTO "Patient" VALUES ("6", "1988-09-01");
INSERT INTO "Patient" VALUES ("7", "1995-04-12");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "4.5", "14.0", "45.0");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-15", "5.0", "16.5", "53.0");
INSERT INTO "Laboratory" VALUES ("1", "2023-03-20", "5.2", "17.0", "54.5");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-05", "4.2", "13.5", "42.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-10", "4.8", "15.0", "48.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-20", "5.1", "16.8", "53.5");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-25", "5.3", "17.2", "55.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-30", "5.0", "16.0", "51.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-12", "4.0", "13.0", "40.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-01", "5.5", "18.0", "56.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-03-05", "5.4", "17.5", "55.5");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-10", "5.3", "17.0", "54.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-01-15", "4.7", "14.5", "46.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-02-20", "4.9", "15.5", "50.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-01-25", "5.0", "16.0", "52.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-02-28", "5.1", "16.5", "53.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-03-10", "5.2", "16.8", "54.0");
INSERT INTO "Examination" VALUES ("2023-01-10");
INSERT INTO "Examination" VALUES ("2023-02-15");
INSERT INTO "Examination" VALUES ("2023-03-20");
INSERT INTO "Examination" VALUES ("2023-01-05");
INSERT INTO "Examination" VALUES ("2023-02-10");
INSERT INTO "Examination" VALUES ("2023-01-20");
INSERT INTO "Examination" VALUES ("2023-02-25");
INSERT INTO "Examination" VALUES ("2023-03-30");
INSERT INTO "Examination" VALUES ("2023-01-12");
INSERT INTO "Examination" VALUES ("2023-02-01");
INSERT INTO "Examination" VALUES ("2023-03-05");
INSERT INTO "Examination" VALUES ("2023-04-10");
INSERT INTO "Examination" VALUES ("2023-01-15");
INSERT INTO "Examination" VALUES ("2023-02-20");
INSERT INTO "Examination" VALUES ("2023-01-25");
INSERT INTO "Examination" VALUES ("2023-02-28");
INSERT INTO "Examination" VALUES ("2023-03-10");