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



INSERT INTO "Examination" VALUES ("1981-01-15", "BEHCET");
INSERT INTO "Examination" VALUES ("1981-02-20", "LUPUS");
INSERT INTO "Examination" VALUES ("1981-03-10", "BEHCET");
INSERT INTO "Examination" VALUES ("1982-04-05", "ARTHRITIS");
INSERT INTO "Examination" VALUES ("1981-05-12", "BEHCET");
INSERT INTO "Examination" VALUES ("1981-06-01", "LUPUS");
INSERT INTO "Examination" VALUES ("1981-07-07", "BEHCET");
INSERT INTO "Examination" VALUES ("1981-08-18", "ARTHRITIS");
INSERT INTO "Examination" VALUES ("1981-09-25", "BEHCET");
INSERT INTO "Examination" VALUES ("1980-10-30", "LUPUS");
INSERT INTO "Laboratory" VALUES ("1", "1981-01-15");
INSERT INTO "Laboratory" VALUES ("2", "1981-02-20");
INSERT INTO "Laboratory" VALUES ("3", "1981-03-10");
INSERT INTO "Laboratory" VALUES ("4", "1982-04-05");
INSERT INTO "Laboratory" VALUES ("5", "1981-05-12");
INSERT INTO "Laboratory" VALUES ("6", "1981-06-01");
INSERT INTO "Laboratory" VALUES ("7", "1981-07-07");
INSERT INTO "Laboratory" VALUES ("8", "1981-08-18");
INSERT INTO "Laboratory" VALUES ("9", "1981-09-25");
INSERT INTO "Laboratory" VALUES ("10", "1980-10-30");
INSERT INTO "Patient" VALUES ("1", "M", "1981-01-01", "BEHCET");
INSERT INTO "Patient" VALUES ("2", "M", "1981-02-01", "LUPUS");
INSERT INTO "Patient" VALUES ("3", "M", "1981-03-01", "BEHCET");
INSERT INTO "Patient" VALUES ("4", "F", "1981-04-01", "ARTHRITIS");
INSERT INTO "Patient" VALUES ("5", "M", "1981-05-01", "BEHCET");
INSERT INTO "Patient" VALUES ("6", "M", "1981-06-01", "LUPUS");
INSERT INTO "Patient" VALUES ("7", "M", "1981-07-01", "BEHCET");
INSERT INTO "Patient" VALUES ("8", "F", "1981-08-01", "ARTHRITIS");
INSERT INTO "Patient" VALUES ("9", "M", "1981-09-01", "BEHCET");
INSERT INTO "Patient" VALUES ("10", "M", "1980-10-01", "LUPUS");
INSERT INTO "Patient" VALUES ("11", "M", "1982-01-01", "BEHCET");
INSERT INTO "Patient" VALUES ("12", "F", "1981-11-01", "BEHCET");
INSERT INTO "Patient" VALUES ("13", "M", "1981-12-01", "ARTHRITIS");
INSERT INTO "Patient" VALUES ("14", "M", "1981-01-10", "BEHCET");
INSERT INTO "Patient" VALUES ("15", "M", "1981-02-15", "ARTHRITIS");
INSERT INTO "Patient" VALUES ("16", "F", "1981-03-20", "LUPUS");
INSERT INTO "Patient" VALUES ("17", "M", "1981-04-25", "BEHCET");
INSERT INTO "Patient" VALUES ("18", "M", "1981-05-30", "ARTHRITIS");
INSERT INTO "Patient" VALUES ("19", "M", "1981-06-05", "BEHCET");
INSERT INTO "Patient" VALUES ("20", "F", "1981-07-10", "LUPUS");