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", "Hospitalized", "Lupus");
INSERT INTO "Patient" VALUES ("3", "M", "1965-03-15", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("4", "M", "1975-08-22", "Hospitalized", "Behcet disease");
INSERT INTO "Patient" VALUES ("5", "F", "1990-01-01", "-", "Rheumatoid Arthritis");
INSERT INTO "Patient" VALUES ("6", "M", "1968-07-07", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("7", "M", "1972-04-12", "-", "Crohns disease");
INSERT INTO "Patient" VALUES ("8", "M", "1960-09-30", "-", "Behcet disease");
INSERT INTO "Patient" VALUES ("9", "F", "1985-02-18", "Hospitalized", "Behcet disease");
INSERT INTO "Patient" VALUES ("10", "M", "1971-06-25", "-", "Behcet disease");
INSERT INTO "Examination" VALUES ("1", "1996-01-15", "Behcet disease", "Joint pain, oral ulcers");
INSERT INTO "Examination" VALUES ("2", "1995-03-20", "Lupus", "Fatigue, rash");
INSERT INTO "Examination" VALUES ("3", "1997-07-01", "Behcet disease", "Eye inflammation");
INSERT INTO "Examination" VALUES ("4", "1996-05-10", "Behcet disease", "Skin lesions");
INSERT INTO "Examination" VALUES ("5", "1998-02-05", "Rheumatoid Arthritis", "Swollen joints");
INSERT INTO "Examination" VALUES ("6", "1995-11-28", "Behcet disease", "Genital ulcers");
INSERT INTO "Examination" VALUES ("7", "1996-09-03", "Crohns disease", "Abdominal pain");
INSERT INTO "Examination" VALUES ("8", "1997-04-20", "Behcet disease", "Neurological symptoms");
INSERT INTO "Examination" VALUES ("9", "1996-06-12", "Behcet disease", "Vascular issues");
INSERT INTO "Examination" VALUES ("10", "1994-12-01", "Behcet disease", "Oral ulcers");
INSERT INTO "Examination" VALUES ("10", "1996-08-01", "Behcet disease", "Oral ulcers");
INSERT INTO "Laboratory" VALUES ("1", "1996-01-10");
INSERT INTO "Laboratory" VALUES ("2", "1995-03-18");
INSERT INTO "Laboratory" VALUES ("3", "1997-06-28");
INSERT INTO "Laboratory" VALUES ("4", "1996-05-08");
INSERT INTO "Laboratory" VALUES ("5", "1998-02-03");
INSERT INTO "Laboratory" VALUES ("6", "1995-11-25");
INSERT INTO "Laboratory" VALUES ("7", "1996-09-01");
INSERT INTO "Laboratory" VALUES ("8", "1997-04-18");
INSERT INTO "Laboratory" VALUES ("9", "1996-06-10");
INSERT INTO "Laboratory" VALUES ("10", "1996-07-30");