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,
"UA" FLOAT,
"U-PRO" TEXT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Examination" VALUES ("2023-01-10", "Hypertension", "Headache");
INSERT INTO "Examination" VALUES ("2023-01-15", "Diabetes", "Fatigue");
INSERT INTO "Examination" VALUES ("2023-01-20", "Kidney Disease", "Swelling");
INSERT INTO "Examination" VALUES ("2023-01-25", "Healthy", "None");
INSERT INTO "Examination" VALUES ("2023-02-01", "Gout", "Joint Pain");
INSERT INTO "Examination" VALUES ("2023-02-05", "Healthy", "None");
INSERT INTO "Examination" VALUES ("2023-02-10", "Kidney Disease", "Nausea");
INSERT INTO "Examination" VALUES ("2023-02-15", "Hypertension", "Dizziness");
INSERT INTO "Examination" VALUES ("2023-02-20", "Diabetes", "Thirst");
INSERT INTO "Examination" VALUES ("2023-02-25", "Healthy", "None");
INSERT INTO "Patient" VALUES ("1");
INSERT INTO "Patient" VALUES ("2");
INSERT INTO "Patient" VALUES ("3");
INSERT INTO "Patient" VALUES ("4");
INSERT INTO "Patient" VALUES ("5");
INSERT INTO "Patient" VALUES ("6");
INSERT INTO "Patient" VALUES ("7");
INSERT INTO "Patient" VALUES ("8");
INSERT INTO "Patient" VALUES ("9");
INSERT INTO "Patient" VALUES ("10");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "5.0", "15.0");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-11", "7.0", "25.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-15", "6.0", "5.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-16", "8.0", "35.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-20", "9.0", "50.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-21", "6.2", "20.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-25", "6.5", "10.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-26", "7.5", "2.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-01", "4.5", "12.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-02", "9.5", "40.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-02-05", "5.8", "28.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-02-06", "7.2", "1.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-02-10", "8.5", "60.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-02-11", "6.0", "18.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-02-15", "7.0", "22.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-02-16", "5.5", "8.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-02-20", "6.8", "3.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-02-21", "7.8", "32.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-02-25", "5.2", "29.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-02-26", "8.2", "0.5");