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" (
"ID" INT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "1929-12-31", "+");
INSERT INTO "Patient" VALUES ("2", "1930-01-01", "+");
INSERT INTO "Patient" VALUES ("3", "1935-06-15", "-");
INSERT INTO "Patient" VALUES ("4", "1940-12-31", "+");
INSERT INTO "Patient" VALUES ("5", "1941-01-01", "-");
INSERT INTO "Patient" VALUES ("6", "1932-03-22", "+");
INSERT INTO "Patient" VALUES ("7", "1938-11-30", "-");
INSERT INTO "Patient" VALUES ("8", "1939-07-07", "+");
INSERT INTO "Patient" VALUES ("9", "1933-05-05", "unknown");
INSERT INTO "Patient" VALUES ("10", "1937-09-09", "+");
INSERT INTO "Patient" VALUES ("11", "1931-01-01", "-");
INSERT INTO "Patient" VALUES ("12", "1934-12-12", "+");
INSERT INTO "Patient" VALUES ("13", "1936-08-08", "NULL");
INSERT INTO "Patient" VALUES ("14", "1940-01-01", "-");
INSERT INTO "Patient" VALUES ("15", "1925-04-04", "+");
INSERT INTO "Patient" VALUES ("16", "1930-05-05", "+");
INSERT INTO "Patient" VALUES ("17", "1939-12-31", "-");
INSERT INTO "Patient" VALUES ("18", "1933-03-03", "+");
INSERT INTO "Patient" VALUES ("19", "1942-02-02", "-");
INSERT INTO "Patient" VALUES ("20", "1937-07-07", "+");