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,
"Symptoms" TEXT
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"TP" FLOAT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "SJS");
INSERT INTO "Patient" VALUES ("2", "SJS");
INSERT INTO "Patient" VALUES ("3", "SJS");
INSERT INTO "Patient" VALUES ("4", "SJS");
INSERT INTO "Patient" VALUES ("5", "SJS");
INSERT INTO "Patient" VALUES ("6", "Other Diagnosis");
INSERT INTO "Patient" VALUES ("7", "Other Diagnosis");
INSERT INTO "Patient" VALUES ("8", "SJS");
INSERT INTO "Patient" VALUES ("9", "Other Diagnosis");
INSERT INTO "Patient" VALUES ("10", "SJS");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "7.2");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-20", "6.5");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-01", "8.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-10", "5.9");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-05", "8.6");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-20", "7.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-25", "6.1");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-01", "7.5");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-12", "6.8");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-01", "6.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-15", "8.4");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-01", "8.5");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-05", "6.0");
INSERT INTO "Examination" VALUES ("2023-01-10", "SJS", "Rash");
INSERT INTO "Examination" VALUES ("2023-01-25", "SJS", "Fever");
INSERT INTO "Examination" VALUES ("2023-02-05", "SJS", "Skin lesions");
INSERT INTO "Examination" VALUES ("2023-03-01", "SJS", "Mucosal lesions");
INSERT INTO "Examination" VALUES ("2023-04-01", "SJS", "Rash");
INSERT INTO "Examination" VALUES ("2023-05-15", "SJS", "Fever");
INSERT INTO "Examination" VALUES ("2023-06-05", "Other Diagnosis", "Headache");
INSERT INTO "Examination" VALUES ("2023-07-01", "Other Diagnosis", "Cough");
INSERT INTO "Examination" VALUES ("2023-08-05", "SJS", "Skin lesions");
INSERT INTO "Examination" VALUES ("2023-09-10", "Other Diagnosis", "Sore throat");
INSERT INTO "Examination" VALUES ("2023-09-20", "SJS", "Rash");