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,
"Diagnosis" TEXT
);

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

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



INSERT INTO "Patient" VALUES ("1", "1960-05-15", "Positive");
INSERT INTO "Patient" VALUES ("2", "1975-10-20", "Negative");
INSERT INTO "Patient" VALUES ("3", "1980-12-01", "Positive");
INSERT INTO "Patient" VALUES ("4", "1955-09-30", "Negative");
INSERT INTO "Patient" VALUES ("5", "1940-10-10", "Positive");
INSERT INTO "Patient" VALUES ("6", "1990-11-25", "Negative");
INSERT INTO "Patient" VALUES ("7", "1965-10-05", "Positive");
INSERT INTO "Patient" VALUES ("8", "1970-07-15", "Negative");
INSERT INTO "Laboratory" VALUES ("1", "1991-10-01");
INSERT INTO "Laboratory" VALUES ("2", "1991-10-15");
INSERT INTO "Laboratory" VALUES ("3", "1991-10-30");
INSERT INTO "Laboratory" VALUES ("4", "1991-09-30");
INSERT INTO "Laboratory" VALUES ("5", "1991-10-20");
INSERT INTO "Laboratory" VALUES ("6", "1991-11-01");
INSERT INTO "Laboratory" VALUES ("7", "1991-10-25");
INSERT INTO "Laboratory" VALUES ("8", "1991-10-05");
INSERT INTO "Examination" VALUES ("1991-10-01", "Positive");
INSERT INTO "Examination" VALUES ("1991-10-15", "Negative");
INSERT INTO "Examination" VALUES ("1991-10-30", "Positive");
INSERT INTO "Examination" VALUES ("1991-09-30", "Negative");
INSERT INTO "Examination" VALUES ("1991-10-20", "Positive");
INSERT INTO "Examination" VALUES ("1991-11-01", "Negative");
INSERT INTO "Examination" VALUES ("1991-10-25", "Positive");
INSERT INTO "Examination" VALUES ("1991-10-05", "Negative");