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" (
"ANA" INT
);

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"RNP" TEXT,
"SM" TEXT,
"SSA" 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", "1980-05-20");
INSERT INTO "Patient" VALUES ("2", "1995-11-15");
INSERT INTO "Patient" VALUES ("3", "2000-01-10");
INSERT INTO "Patient" VALUES ("4", "1990-07-30");
INSERT INTO "Patient" VALUES ("5", "2000-01-10");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-01", "-", "+-", "+");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-02", "+", "-", "-");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-03", "+-", "+", "-");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-01", "++", "-", "+");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-04", "-", "-", "-");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-05", "++", "+", "+");
INSERT INTO "Examination" VALUES ("0");