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,
"ANA" INT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"IGG" INT,
"IGA" INT,
"IGM" INT,
PRIMARY KEY ("ID", "Date")
);

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



INSERT INTO "Patient" VALUES ("3605339");
INSERT INTO "Patient" VALUES ("3605340");
INSERT INTO "Patient" VALUES ("3605341");
INSERT INTO "Examination" VALUES ("3605339", "1996-12-02", "15");
INSERT INTO "Examination" VALUES ("3605340", "1996-12-01", "20");
INSERT INTO "Examination" VALUES ("3605340", "1996-12-02", "35");
INSERT INTO "Examination" VALUES ("3605340", "1997-01-15", "40");
INSERT INTO "Examination" VALUES ("3605341", "1996-12-02", "10");
INSERT INTO "Laboratory" VALUES ("3605339", "1996-12-02", "100", "200", "300");
INSERT INTO "Laboratory" VALUES ("3605340", "1996-12-02", "110", "210", "310");
INSERT INTO "Laboratory" VALUES ("3605340", "1996-12-03", "115", "215", "315");
INSERT INTO "Laboratory" VALUES ("3605341", "1996-12-02", "120", "220", "320");