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,
"CRP" TEXT,
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", "1980-07-15");
INSERT INTO "Patient" VALUES ("3", "M", "1965-12-01");
INSERT INTO "Patient" VALUES ("4", "M", "1990-03-10");
INSERT INTO "Patient" VALUES ("5", "F", "1975-11-30");
INSERT INTO "Patient" VALUES ("6", "M", "1985-08-25");
INSERT INTO "Patient" VALUES ("7", "M", "1978-01-05");
INSERT INTO "Patient" VALUES ("8", "F", "1992-09-17");
INSERT INTO "Patient" VALUES ("9", "M", "1960-06-22");
INSERT INTO "Patient" VALUES ("10", "M", "1972-04-14");
INSERT INTO "Laboratory" VALUES ("1", "1998-01-15", "5.2");
INSERT INTO "Laboratory" VALUES ("1", "1998-02-20", "4.8");
INSERT INTO "Laboratory" VALUES ("1", "1998-03-10", "5.0");
INSERT INTO "Laboratory" VALUES ("3", "1998-01-05", "3.1");
INSERT INTO "Laboratory" VALUES ("3", "1998-04-22", "3.5");
INSERT INTO "Laboratory" VALUES ("4", "1998-05-30", "6.0");
INSERT INTO "Laboratory" VALUES ("6", "1998-06-15", "2.9");
INSERT INTO "Laboratory" VALUES ("7", "1998-07-19", "4.0");
INSERT INTO "Laboratory" VALUES ("7", "1998-08-25", "4.2");
INSERT INTO "Laboratory" VALUES ("9", "1998-09-10", "5.5");
INSERT INTO "Laboratory" VALUES ("9", "1998-10-05", "5.7");
INSERT INTO "Laboratory" VALUES ("10", "1998-11-11", "3.8");
INSERT INTO "Laboratory" VALUES ("10", "1998-12-20", "4.1");
INSERT INTO "Laboratory" VALUES ("2", "1998-03-15", "2.5");
INSERT INTO "Laboratory" VALUES ("5", "1998-07-07", "3.3");
INSERT INTO "Laboratory" VALUES ("8", "1998-10-30", "4.4");
INSERT INTO "Laboratory" VALUES ("1", "1997-12-31", "5.0");
INSERT INTO "Laboratory" VALUES ("3", "1999-01-01", "3.0");