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,
"CRE" FLOAT,
"GLU" INT,
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", "1960-05-15");
INSERT INTO "Patient" VALUES ("2", "F", "1975-12-30");
INSERT INTO "Patient" VALUES ("3", "M", "1980-07-22");
INSERT INTO "Patient" VALUES ("4", "F", "1955-03-10");
INSERT INTO "Patient" VALUES ("5", "M", "1965-11-05");
INSERT INTO "Laboratory" VALUES ("1", "1991-10-21", "8.4", "1.2", "90");
INSERT INTO "Laboratory" VALUES ("1", "1992-05-10", "7.8", "1.1", "85");
INSERT INTO "Laboratory" VALUES ("2", "1991-10-21", "6.5", "1.3", "88");
INSERT INTO "Laboratory" VALUES ("3", "1991-10-21", "8.4", "1.0", "92");
INSERT INTO "Laboratory" VALUES ("4", "1990-12-15", "5.9", "1.4", "80");
INSERT INTO "Laboratory" VALUES ("5", "1991-10-21", "7.0", "1.2", "95");
INSERT INTO "Laboratory" VALUES ("3", "1992-01-01", "8.0", "1.1", "90");