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" (
"ID" INT,
"Examination Date" DATE,
"aCL IgG" FLOAT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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

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



INSERT INTO "Patient" VALUES ("1");
INSERT INTO "Patient" VALUES ("2");
INSERT INTO "Patient" VALUES ("3");
INSERT INTO "Patient" VALUES ("4");
INSERT INTO "Patient" VALUES ("5");
INSERT INTO "Patient" VALUES ("6");
INSERT INTO "Patient" VALUES ("7");
INSERT INTO "Examination" VALUES ("1", "1998-05-10", "12.5");
INSERT INTO "Examination" VALUES ("2", "1996-12-31", "8.0");
INSERT INTO "Examination" VALUES ("3", "2000-01-15", "15.2");
INSERT INTO "Examination" VALUES ("4", "1997-01-02", "7.7");
INSERT INTO "Examination" VALUES ("5", "1999-11-20", "9.9");
INSERT INTO "Examination" VALUES ("6", "1995-07-07", "11.1");
INSERT INTO "Examination" VALUES ("7", "2001-03-03", "10.0");
INSERT INTO "Laboratory" VALUES ("1", "1998-05-11", "negative", "positive", "negative");
INSERT INTO "Laboratory" VALUES ("2", "1997-01-01", "positive", "negative", "negative");
INSERT INTO "Laboratory" VALUES ("3", "2000-01-16", "0", "negative", "positive");
INSERT INTO "Laboratory" VALUES ("4", "1997-01-03", "negative", "negative", "negative");
INSERT INTO "Laboratory" VALUES ("5", "1999-11-21", "positive", "positive", "positive");
INSERT INTO "Laboratory" VALUES ("6", "1995-07-08", "0", "positive", "negative");
INSERT INTO "Laboratory" VALUES ("7", "2001-03-04", "negative", "negative", "positive");