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,
"PT" FLOAT,
"CRP" TEXT,
PRIMARY KEY ("ID", "Date")
);

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
"Diagnosis" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "SLE");
INSERT INTO "Patient" VALUES ("2", "SLE");
INSERT INTO "Patient" VALUES ("3", "Rheumatoid Arthritis");
INSERT INTO "Patient" VALUES ("4", "SLE");
INSERT INTO "Patient" VALUES ("5", "Lupus");
INSERT INTO "Patient" VALUES ("6", "SLE");
INSERT INTO "Patient" VALUES ("7", "Fibromyalgia");
INSERT INTO "Patient" VALUES ("8", "SLE");
INSERT INTO "Patient" VALUES ("9", "SLE");
INSERT INTO "Patient" VALUES ("10", "Psoriasis");
INSERT INTO "Examination" VALUES ("1", "2023-01-15", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("1", "2023-03-20", "SLE", "Joint Pain");
INSERT INTO "Examination" VALUES ("2", "2023-02-10", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("2", "2023-04-01", "SLE", "Rash");
INSERT INTO "Examination" VALUES ("3", "2023-01-25", "Rheumatoid Arthritis", "Joint Swelling");
INSERT INTO "Examination" VALUES ("4", "2023-03-05", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("4", "2023-05-10", "SLE", "Hair Loss");
INSERT INTO "Examination" VALUES ("5", "2023-02-20", "Lupus", "Fatigue");
INSERT INTO "Examination" VALUES ("6", "2023-04-15", "SLE", "Joint Pain");
INSERT INTO "Examination" VALUES ("6", "2023-06-01", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("7", "2023-03-10", "Fibromyalgia", "Chronic Pain");
INSERT INTO "Examination" VALUES ("8", "2023-05-20", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("8", "2023-07-01", "SLE", "Photosensitivity");
INSERT INTO "Examination" VALUES ("9", "2023-06-10", "SLE", "Fatigue");
INSERT INTO "Examination" VALUES ("9", "2023-08-05", "SLE", "Oral Ulcers");
INSERT INTO "Examination" VALUES ("10", "2023-04-25", "Psoriasis", "Skin Lesions");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "12.5", "Normal");
INSERT INTO "Laboratory" VALUES ("1", "2023-03-20", "13.0", "Elevated");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-10", "11.8", "Normal");
INSERT INTO "Laboratory" VALUES ("2", "2023-04-01", "12.2", "Normal");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-25", "14.0", "Elevated");
INSERT INTO "Laboratory" VALUES ("4", "2023-03-05", "12.0", "Normal");
INSERT INTO "Laboratory" VALUES ("4", "2023-05-10", "12.8", "Normal");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-20", "13.5", "Elevated");
INSERT INTO "Laboratory" VALUES ("6", "2023-04-15", "12.1", "Normal");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-01", "12.6", "Normal");
INSERT INTO "Laboratory" VALUES ("7", "2023-03-10", "11.9", "Normal");
INSERT INTO "Laboratory" VALUES ("8", "2023-05-20", "12.3", "Normal");
INSERT INTO "Laboratory" VALUES ("8", "2023-07-01", "12.9", "Elevated");
INSERT INTO "Laboratory" VALUES ("9", "2023-06-10", "12.4", "Normal");
INSERT INTO "Laboratory" VALUES ("9", "2023-08-05", "13.1", "Normal");
INSERT INTO "Laboratory" VALUES ("10", "2023-04-25", "13.8", "Elevated");