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

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

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



INSERT INTO "Examination" VALUES ("Thrombosis", "Chest Pain");
INSERT INTO "Examination" VALUES ("Pneumonia", "Cough");
INSERT INTO "Examination" VALUES ("Appendicitis", "Abdominal Pain");
INSERT INTO "Examination" VALUES ("Flu", "Fever");
INSERT INTO "Examination" VALUES ("Broken Leg", "Swelling");
INSERT INTO "Examination" VALUES ("Thrombosis", "Shortness of Breath");
INSERT INTO "Examination" VALUES ("Anemia", "Fatigue");
INSERT INTO "Examination" VALUES ("Diabetes", "Increased Thirst");
INSERT INTO "Examination" VALUES ("Hypertension", "Headache");
INSERT INTO "Examination" VALUES ("Asthma", "Wheezing");
INSERT INTO "Patient" VALUES ("1", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "-", "Pneumonia");
INSERT INTO "Patient" VALUES ("3", "+", "Appendicitis");
INSERT INTO "Patient" VALUES ("4", "+", "Flu");
INSERT INTO "Patient" VALUES ("5", "-", "Broken Leg");
INSERT INTO "Patient" VALUES ("6", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("7", "-", "Anemia");
INSERT INTO "Patient" VALUES ("8", "+", "Diabetes");
INSERT INTO "Patient" VALUES ("9", "-", "Hypertension");
INSERT INTO "Patient" VALUES ("10", "+", "Asthma");
INSERT INTO "Patient" VALUES ("11", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("12", "-", "Flu");
INSERT INTO "Patient" VALUES ("13", "+", "Pneumonia");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "350");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-11", "280");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-12", "150");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-13", "400");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-14", "200");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-15", "180");
INSERT INTO "Laboratory" VALUES ("6", "2023-01-16", "310");
INSERT INTO "Laboratory" VALUES ("7", "2023-01-17", "250");
INSERT INTO "Laboratory" VALUES ("8", "2023-01-18", "300");
INSERT INTO "Laboratory" VALUES ("9", "2023-01-19", "100");
INSERT INTO "Laboratory" VALUES ("10", "2023-01-20", "290");
INSERT INTO "Laboratory" VALUES ("11", "2023-01-21", "320");
INSERT INTO "Laboratory" VALUES ("12", "2023-01-22", "270");
INSERT INTO "Laboratory" VALUES ("13", "2023-01-23", "380");