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,
"UA" FLOAT,
"UN" INT,
"CRE" FLOAT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "F", "1980-05-12");
INSERT INTO "Patient" VALUES ("2", "F", "1992-11-23");
INSERT INTO "Patient" VALUES ("3", "F", "1975-07-30");
INSERT INTO "Patient" VALUES ("4", "F", "2000-01-15");
INSERT INTO "Patient" VALUES ("5", "F", "1988-03-05");
INSERT INTO "Patient" VALUES ("6", "M", "1985-09-10");
INSERT INTO "Patient" VALUES ("7", "M", "1990-12-01");
INSERT INTO "Patient" VALUES ("8", "M", "1978-06-20");
INSERT INTO "Patient" VALUES ("9", "M", "2002-04-18");
INSERT INTO "Patient" VALUES ("10", "M", "1995-08-25");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "6.5", "15", "0.9");
INSERT INTO "Laboratory" VALUES ("1", "2024-02-10", "6.6", "14", "0.8");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-15", "6.4", "16", "1.0");
INSERT INTO "Laboratory" VALUES ("3", "2024-03-20", "7.0", "18", "1.1");
INSERT INTO "Laboratory" VALUES ("4", "2024-04-25", "5.0", "12", "0.7");
INSERT INTO "Laboratory" VALUES ("5", "2024-05-30", "6.5", "14", "0.9");
INSERT INTO "Laboratory" VALUES ("6", "2024-01-05", "8.0", "20", "1.2");
INSERT INTO "Laboratory" VALUES ("7", "2024-02-15", "8.1", "22", "1.3");
INSERT INTO "Laboratory" VALUES ("8", "2024-03-10", "7.9", "19", "1.1");
INSERT INTO "Laboratory" VALUES ("9", "2024-04-12", "9.0", "21", "1.4");
INSERT INTO "Laboratory" VALUES ("10", "2024-05-18", "7.5", "18", "1.0");
INSERT INTO "Laboratory" VALUES ("2", "2024-06-01", "6.7", "15", "0.95");
INSERT INTO "Laboratory" VALUES ("3", "2024-07-01", "6.3", "17", "1.05");
INSERT INTO "Laboratory" VALUES ("4", "2024-08-01", "7.2", "13", "0.85");
INSERT INTO "Laboratory" VALUES ("5", "2024-09-01", "5.8", "14", "0.9");