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,
"Examination Date" DATE,
"Diagnosis" TEXT,
"Symptoms" TEXT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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

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



INSERT INTO "Patient" VALUES ("1", "M", "1970-05-10", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("2", "F", "1980-11-20", "Admitted", "Lupus");
INSERT INTO "Patient" VALUES ("3", "M", "1965-03-15", "Admitted", "Behcet disease");
INSERT INTO "Patient" VALUES ("4", "M", "1975-08-22", "-", "Crohns disease");
INSERT INTO "Patient" VALUES ("5", "M", "1972-01-30", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("6", "F", "1990-04-01", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("7", "M", "1968-07-07", "Admitted", "Rheumatoid Arthritis");
INSERT INTO "Patient" VALUES ("8", "M", "1985-02-14", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("9", "M", "1973-09-25", "Admitted", "Behcet disease");
INSERT INTO "Patient" VALUES ("10", "M", "1960-12-05", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("11", "M", "1971-06-18", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("12", "M", "1976-03-03", "Admitted", "Behcet disease");
INSERT INTO "Patient" VALUES ("13", "M", "1982-10-10", "-", "Ulcerative Colitis");
INSERT INTO "Patient" VALUES ("14", "M", "1969-01-20", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("15", "M", "1974-04-04", "-", "Behcet disease");
INSERT INTO "Examination" VALUES ("1", "1996-03-01", "Behcet disease", "Oral ulcers");
INSERT INTO "Examination" VALUES ("2", "1995-07-15", "Lupus", "Joint pain");
INSERT INTO "Examination" VALUES ("3", "1997-01-20", "Behcet disease", "Genital ulcers");
INSERT INTO "Examination" VALUES ("4", "1994-11-10", "Crohns disease", "Abdominal pain");
INSERT INTO "Examination" VALUES ("5", "1996-09-05", "Behcet disease", "Skin lesions");
INSERT INTO "Examination" VALUES ("6", "1998-02-28", "Behcet disease", "Eye inflammation");
INSERT INTO "Examination" VALUES ("7", "1995-05-12", "Rheumatoid Arthritis", "Swollen joints");
INSERT INTO "Examination" VALUES ("8", "1996-06-20", "Behcet disease", "Oral ulcers");
INSERT INTO "Examination" VALUES ("9", "1997-04-01", "Behcet disease", "Genital ulcers");
INSERT INTO "Examination" VALUES ("10", "1996-08-10", "Behcet disease", "Skin lesions");
INSERT INTO "Examination" VALUES ("10", "1998-01-01", "Behcet disease", "Eye inflammation");
INSERT INTO "Examination" VALUES ("11", "1995-02-01", "Behcet disease", "Oral ulcers");
INSERT INTO "Examination" VALUES ("12", "1997-07-07", "Behcet disease", "Genital ulcers");
INSERT INTO "Examination" VALUES ("13", "1996-10-10", "Ulcerative Colitis", "Diarrhea");
INSERT INTO "Examination" VALUES ("14", "1995-09-09", "Behcet disease", "Skin lesions");
INSERT INTO "Examination" VALUES ("15", "1997-03-15", "Behcet disease", "Eye inflammation");
INSERT INTO "Examination" VALUES ("1", "1994-01-01", "Behcet disease", "Fatigue");
INSERT INTO "Examination" VALUES ("5", "1998-05-05", "Behcet disease", "Headache");
INSERT INTO "Laboratory" VALUES ("1", "1996-03-02");
INSERT INTO "Laboratory" VALUES ("2", "1995-07-16");
INSERT INTO "Laboratory" VALUES ("3", "1997-01-21");
INSERT INTO "Laboratory" VALUES ("5", "1996-09-06");
INSERT INTO "Laboratory" VALUES ("8", "1996-06-21");
INSERT INTO "Laboratory" VALUES ("10", "1996-08-11");
INSERT INTO "Laboratory" VALUES ("11", "1995-02-02");
INSERT INTO "Laboratory" VALUES ("14", "1995-09-10");
INSERT INTO "Laboratory" VALUES ("15", "1997-03-16");