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



INSERT INTO "Examination" VALUES ("2023-01-15", "RA");
INSERT INTO "Examination" VALUES ("2023-02-20", "Lupus");
INSERT INTO "Examination" VALUES ("2023-03-10", "RA");
INSERT INTO "Examination" VALUES ("2023-04-05", "Fibromyalgia");
INSERT INTO "Examination" VALUES ("2023-05-01", "RA");
INSERT INTO "Examination" VALUES ("2023-06-12", "Osteoarthritis");
INSERT INTO "Examination" VALUES ("2023-07-22", "RA");
INSERT INTO "Examination" VALUES ("2023-08-30", "Gout");
INSERT INTO "Examination" VALUES ("2023-09-18", "RA");
INSERT INTO "Examination" VALUES ("2023-10-25", "Psoriatic Arthritis");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-15");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-05");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-01");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-28");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-08");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-19");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-25");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-15");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-20");
INSERT INTO "Patient" VALUES ("1", "F", "1980-03-10", "RA");
INSERT INTO "Patient" VALUES ("2", "M", "1980-07-22", "RA");
INSERT INTO "Patient" VALUES ("3", "F", "1980-11-05", "RA");
INSERT INTO "Patient" VALUES ("4", "M", "1980-01-15", "RA");
INSERT INTO "Patient" VALUES ("5", "F", "1980-09-01", "RA");
INSERT INTO "Patient" VALUES ("6", "M", "1981-02-28", "RA");
INSERT INTO "Patient" VALUES ("7", "F", "1979-06-18", "RA");
INSERT INTO "Patient" VALUES ("8", "M", "1980-04-20", "Lupus");
INSERT INTO "Patient" VALUES ("9", "F", "1980-08-12", "Fibromyalgia");
INSERT INTO "Patient" VALUES ("10", "F", "1980-12-25", "RA");
INSERT INTO "Patient" VALUES ("11", "F", "1980-05-05", "RA");
INSERT INTO "Patient" VALUES ("12", "M", "1980-02-14", "RA");
INSERT INTO "Patient" VALUES ("13", "F", "1980-06-30", "RA");
INSERT INTO "Patient" VALUES ("14", "M", "1980-10-01", "RA");
INSERT INTO "Patient" VALUES ("15", "F", "1980-03-20", "Osteoarthritis");
INSERT INTO "Patient" VALUES ("16", "F", "1980-07-07", "RA");
INSERT INTO "Patient" VALUES ("17", "M", "1980-09-10", "RA");
INSERT INTO "Patient" VALUES ("18", "F", "1980-01-01", "RA");
INSERT INTO "Patient" VALUES ("19", "M", "1980-04-04", "RA");
INSERT INTO "Patient" VALUES ("20", "F", "1980-11-11", "RA");