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,
"ANA" INT,
"Diagnosis" TEXT
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"SM" TEXT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
"Birthday" DATE,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "2005-05-20");
INSERT INTO "Patient" VALUES ("2", "2010-11-15");
INSERT INTO "Patient" VALUES ("3", "2008-07-30");
INSERT INTO "Patient" VALUES ("4", "2012-01-10");
INSERT INTO "Patient" VALUES ("5", "2003-03-25");
INSERT INTO "Patient" VALUES ("6", "2011-09-05");
INSERT INTO "Patient" VALUES ("7", "2009-12-12");
INSERT INTO "Patient" VALUES ("8", "2013-06-18");
INSERT INTO "Patient" VALUES ("9", "2007-04-22");
INSERT INTO "Patient" VALUES ("10", "2014-08-01");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "negative");
INSERT INTO "Laboratory" VALUES ("1", "2023-06-15", "positive");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-20", "0");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-05", "elevated");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-12", "low");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-18", "negative");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-22", "positive");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-30", "0");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-14", "high");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-01", "negative");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-10", "positive");
INSERT INTO "Examination" VALUES ("12.5", "1", "Thrombosis");
INSERT INTO "Examination" VALUES ("8.0", "0", "No Thrombosis");
INSERT INTO "Examination" VALUES ("15.2", "1", "Thrombosis");
INSERT INTO "Examination" VALUES ("7.8", "0", "No Thrombosis");
INSERT INTO "Examination" VALUES ("10.0", "1", "Thrombosis");
INSERT INTO "Examination" VALUES ("9.5", "0", "No Thrombosis");
INSERT INTO "Examination" VALUES ("11.1", "1", "Thrombosis");
INSERT INTO "Examination" VALUES ("6.7", "0", "No Thrombosis");
INSERT INTO "Examination" VALUES ("13.3", "1", "Thrombosis");
INSERT INTO "Examination" VALUES ("5.5", "0", "No Thrombosis");