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 "Laboratory" (
"ID" INT,
"Date" DATE,
"GPT" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "1980-05-10", "Hypertension");
INSERT INTO "Patient" VALUES ("2", "1995-11-22", "Diabetes");
INSERT INTO "Patient" VALUES ("3", "1975-03-15", "Liver Disease");
INSERT INTO "Patient" VALUES ("4", "1990-08-01", "Healthy");
INSERT INTO "Patient" VALUES ("5", "1960-01-20", "Kidney Failure");
INSERT INTO "Patient" VALUES ("6", "2000-07-07", "Obesity");
INSERT INTO "Patient" VALUES ("7", "1985-04-25", "Thyroid Disorder");
INSERT INTO "Patient" VALUES ("8", "1970-12-03", "Heart Disease");
INSERT INTO "Patient" VALUES ("9", "1998-02-14", "Anemia");
INSERT INTO "Patient" VALUES ("10", "1965-09-09", "Asthma");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "55");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-16", "70");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-17", "85");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-18", "40");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-19", "62");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-01", "65");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-02", "58");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-03", "90");
INSERT INTO "Laboratory" VALUES ("6", "2023-03-01", "75");
INSERT INTO "Laboratory" VALUES ("7", "2023-03-02", "50");
INSERT INTO "Laboratory" VALUES ("8", "2023-03-03", "68");
INSERT INTO "Laboratory" VALUES ("9", "2023-03-04", "59");
INSERT INTO "Laboratory" VALUES ("10", "2023-03-05", "45");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-01", "61");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-02", "57");
INSERT INTO "Laboratory" VALUES ("1", "2023-04-03", "50");
INSERT INTO "Laboratory" VALUES ("3", "2023-04-04", "72");
INSERT INTO "Laboratory" VALUES ("2", "2023-04-05", "63");
INSERT INTO "Laboratory" VALUES ("6", "2023-04-06", "55");
INSERT INTO "Laboratory" VALUES ("8", "2023-04-07", "70");