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

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



INSERT INTO "Examination" VALUES ("2023-01-15", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-01-16", "Flu");
INSERT INTO "Examination" VALUES ("2023-01-17", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-01-18", "Cold");
INSERT INTO "Examination" VALUES ("2023-01-19", "Thrombosis");
INSERT INTO "Examination" VALUES ("2023-01-20", "Broken Leg");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-16");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-17");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-18");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-19");
INSERT INTO "Laboratory" VALUES ("6", "2023-01-20");
INSERT INTO "Patient" VALUES ("1", "F", "1964-05-10", "+");
INSERT INTO "Patient" VALUES ("2", "M", "1964-11-22", "+");
INSERT INTO "Patient" VALUES ("3", "F", "1964-02-29", "+");
INSERT INTO "Patient" VALUES ("4", "F", "1965-07-01", "+");
INSERT INTO "Patient" VALUES ("5", "M", "1963-03-15", "+");
INSERT INTO "Patient" VALUES ("6", "F", "1964-09-01", "-");
INSERT INTO "Patient" VALUES ("7", "F", "1964-01-01", "+");
INSERT INTO "Patient" VALUES ("8", "M", "1964-12-31", "+");
INSERT INTO "Patient" VALUES ("9", "F", "1964-06-06", "+");
INSERT INTO "Patient" VALUES ("10", "F", "1964-08-12", "+");
INSERT INTO "Patient" VALUES ("11", "F", "1964-04-04", "+");
INSERT INTO "Patient" VALUES ("12", "F", "1964-10-10", "+");