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,
"aCL IgM" FLOAT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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

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



INSERT INTO "Patient" VALUES ("1", "1994-02-19", "SLE");
INSERT INTO "Patient" VALUES ("2", "1995-05-20", "RA");
INSERT INTO "Patient" VALUES ("3", "1993-10-01", "SLE");
INSERT INTO "Patient" VALUES ("4", "1994-02-19", "Lupus");
INSERT INTO "Patient" VALUES ("5", "1996-01-15", "SLE");
INSERT INTO "Examination" VALUES ("1", "1993-11-12", "15.2", "25.8");
INSERT INTO "Examination" VALUES ("1", "1994-01-01", "10.0", "18.5");
INSERT INTO "Examination" VALUES ("2", "1995-03-10", "5.1", "8.2");
INSERT INTO "Examination" VALUES ("3", "1993-09-01", "20.5", "30.1");
INSERT INTO "Examination" VALUES ("1", "1993-11-13", "16.0", "26.0");
INSERT INTO "Examination" VALUES ("5", "1995-12-01", "12.3", "22.7");
INSERT INTO "Laboratory" VALUES ("1", "1993-11-12");
INSERT INTO "Laboratory" VALUES ("1", "1994-01-01");
INSERT INTO "Laboratory" VALUES ("2", "1995-03-10");
INSERT INTO "Laboratory" VALUES ("3", "1993-09-01");
INSERT INTO "Laboratory" VALUES ("5", "1995-12-01");