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", "M", "1980-05-12");
INSERT INTO "Patient" VALUES ("2", "F", "1975-11-23");
INSERT INTO "Patient" VALUES ("3", "M", "1990-07-30");
INSERT INTO "Patient" VALUES ("4", "F", "1985-02-14");
INSERT INTO "Patient" VALUES ("5", "M", "2000-12-01");
INSERT INTO "Patient" VALUES ("6", "F", "1995-08-19");
INSERT INTO "Patient" VALUES ("7", "M", "1970-03-05");
INSERT INTO "Patient" VALUES ("8", "F", "1988-09-09");
INSERT INTO "Patient" VALUES ("9", "M", "1965-01-20");
INSERT INTO "Patient" VALUES ("10", "F", "2002-06-15");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "5.2", "20", "1.6");
INSERT INTO "Laboratory" VALUES ("1", "2023-06-10", "5.0", "22", "1.4");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-15", "4.8", "18", "1.7");
INSERT INTO "Laboratory" VALUES ("2", "2023-07-15", "4.9", "19", "1.3");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-20", "5.5", "21", "1.8");
INSERT INTO "Laboratory" VALUES ("4", "2023-03-25", "5.1", "20", "1.2");
INSERT INTO "Laboratory" VALUES ("5", "2023-04-30", "5.3", "23", "1.9");
INSERT INTO "Laboratory" VALUES ("6", "2023-05-05", "4.7", "17", "1.6");
INSERT INTO "Laboratory" VALUES ("7", "2023-06-10", "5.4", "22", "1.5");
INSERT INTO "Laboratory" VALUES ("8", "2023-07-15", "4.6", "18", "1.4");
INSERT INTO "Laboratory" VALUES ("9", "2023-08-20", "5.0", "20", "1.7");
INSERT INTO "Laboratory" VALUES ("10", "2023-09-25", "4.9", "19", "1.3");
INSERT INTO "Laboratory" VALUES ("6", "2023-10-01", "4.8", "18", "1.4");
INSERT INTO "Laboratory" VALUES ("4", "2023-11-05", "5.2", "21", "1.6");
INSERT INTO "Laboratory" VALUES ("8", "2023-12-10", "4.5", "17", "1.5");