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 ("57266", "M", "1980-05-15");
INSERT INTO "Patient" VALUES ("57267", "F", "1975-11-30");
INSERT INTO "Patient" VALUES ("57268", "M", "1990-07-22");
INSERT INTO "Patient" VALUES ("57269", "F", "1988-03-10");
INSERT INTO "Patient" VALUES ("57270", "M", "1965-12-01");
INSERT INTO "Laboratory" VALUES ("57266", "2024-01-10", "7.9", "25", "1.1");
INSERT INTO "Laboratory" VALUES ("57266", "2024-02-15", "8.1", "30", "1.0");
INSERT INTO "Laboratory" VALUES ("57267", "2024-01-12", "6.4", "20", "0.9");
INSERT INTO "Laboratory" VALUES ("57267", "2024-03-05", "6.6", "22", "1.2");
INSERT INTO "Laboratory" VALUES ("57268", "2024-01-20", "8.0", "28", "1.3");
INSERT INTO "Laboratory" VALUES ("57269", "2024-02-25", "6.5", "18", "1.0");
INSERT INTO "Laboratory" VALUES ("57270", "2024-03-15", "8.5", "35", "1.4");