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,
"T-CHO" INT,
"TG" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("2927464", "M");
INSERT INTO "Patient" VALUES ("1000001", "F");
INSERT INTO "Patient" VALUES ("1000002", "M");
INSERT INTO "Patient" VALUES ("1000003", "F");
INSERT INTO "Laboratory" VALUES ("2927464", "1995-09-04", "249", "150");
INSERT INTO "Laboratory" VALUES ("2927464", "1995-09-05", "251", "160");
INSERT INTO "Laboratory" VALUES ("2927464", "1995-09-03", "300", "140");
INSERT INTO "Laboratory" VALUES ("1000001", "1995-09-04", "200", "130");
INSERT INTO "Laboratory" VALUES ("1000002", "1995-09-04", "260", "170");
INSERT INTO "Laboratory" VALUES ("1000003", "1995-09-04", "249", "180");
INSERT INTO "Laboratory" VALUES ("2927464", "1995-09-06", "250", "155");