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 "Examination" (
"aCL IgG" FLOAT
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"TP" FLOAT,
"ALB" FLOAT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "No thrombosis");
INSERT INTO "Patient" VALUES ("3", "Thrombosis");
INSERT INTO "Patient" VALUES ("4", "No thrombosis");
INSERT INTO "Patient" VALUES ("5", "Thrombosis");
INSERT INTO "Patient" VALUES ("6", "No thrombosis");
INSERT INTO "Patient" VALUES ("7", "Thrombosis");
INSERT INTO "Patient" VALUES ("8", "No thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "1997-01-15", "5.9", "3.5");
INSERT INTO "Laboratory" VALUES ("1", "1998-03-20", "7.0", "3.8");
INSERT INTO "Laboratory" VALUES ("2", "1997-06-10", "6.5", "4.0");
INSERT INTO "Laboratory" VALUES ("3", "1997-11-05", "8.6", "3.2");
INSERT INTO "Laboratory" VALUES ("4", "1997-07-22", "7.5", "3.9");
INSERT INTO "Laboratory" VALUES ("5", "1997-12-30", "5.5", "3.7");
INSERT INTO "Laboratory" VALUES ("6", "1996-05-14", "7.2", "3.6");
INSERT INTO "Laboratory" VALUES ("7", "1997-09-09", "8.7", "3.4");
INSERT INTO "Laboratory" VALUES ("8", "1997-04-18", "6.0", "3.3");
INSERT INTO "Examination" VALUES ("12.5");
INSERT INTO "Examination" VALUES ("8.0");
INSERT INTO "Examination" VALUES ("15.0");
INSERT INTO "Examination" VALUES ("9.5");
INSERT INTO "Examination" VALUES ("11.0");
INSERT INTO "Examination" VALUES ("7.0");
INSERT INTO "Examination" VALUES ("13.0");
INSERT INTO "Examination" VALUES ("10.0");