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" (
"Examination Date" DATE
);

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

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



INSERT INTO "Examination" VALUES ("1998-01-15");
INSERT INTO "Examination" VALUES ("1999-03-20");
INSERT INTO "Examination" VALUES ("2001-07-10");
INSERT INTO "Examination" VALUES ("1997-11-05");
INSERT INTO "Examination" VALUES ("2000-02-28");
INSERT INTO "Examination" VALUES ("1999-09-12");
INSERT INTO "Examination" VALUES ("2002-04-01");
INSERT INTO "Examination" VALUES ("1996-06-25");
INSERT INTO "Examination" VALUES ("2000-10-30");
INSERT INTO "Examination" VALUES ("1998-05-18");
INSERT INTO "Patient" VALUES ("1", "1997-01-01");
INSERT INTO "Patient" VALUES ("2", "1998-02-10");
INSERT INTO "Patient" VALUES ("3", "1999-03-15");
INSERT INTO "Patient" VALUES ("4", "2000-04-20");
INSERT INTO "Patient" VALUES ("5", "1996-05-05");
INSERT INTO "Patient" VALUES ("6", "2001-06-10");
INSERT INTO "Patient" VALUES ("7", "1999-07-25");
INSERT INTO "Patient" VALUES ("8", "1995-08-01");
INSERT INTO "Patient" VALUES ("9", "2002-09-15");
INSERT INTO "Patient" VALUES ("10", "1998-10-30");
INSERT INTO "Laboratory" VALUES ("1", "1997-01-05", "-", "-");
INSERT INTO "Laboratory" VALUES ("1", "1997-02-01", "+-", "+");
INSERT INTO "Laboratory" VALUES ("2", "1998-02-15", "+", "-");
INSERT INTO "Laboratory" VALUES ("3", "1999-03-20", "-", "+-");
INSERT INTO "Laboratory" VALUES ("4", "2000-04-25", "+-", "-");
INSERT INTO "Laboratory" VALUES ("5", "1996-05-10", "-", "-");
INSERT INTO "Laboratory" VALUES ("5", "1996-06-01", "+", "+");
INSERT INTO "Laboratory" VALUES ("6", "2001-06-15", "+", "-");
INSERT INTO "Laboratory" VALUES ("7", "1999-07-30", "+-", "+");
INSERT INTO "Laboratory" VALUES ("8", "1995-08-05", "-", "-");
INSERT INTO "Laboratory" VALUES ("8", "1995-09-01", "+-", "-");
INSERT INTO "Laboratory" VALUES ("9", "2002-09-20", "+", "+");
INSERT INTO "Laboratory" VALUES ("10", "1998-11-05", "-", "+-");
INSERT INTO "Laboratory" VALUES ("10", "1998-12-01", "+", "-");