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" (
"aCL IgG" FLOAT,
"aCL IgM" FLOAT,
"aCL IgA" INT
);

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

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



INSERT INTO "Patient" VALUES ("1", "NULL");
INSERT INTO "Patient" VALUES ("2", "2023-01-15");
INSERT INTO "Patient" VALUES ("3", "NULL");
INSERT INTO "Patient" VALUES ("4", "2022-12-01");
INSERT INTO "Patient" VALUES ("5", "NULL");
INSERT INTO "Patient" VALUES ("6", "2023-03-20");
INSERT INTO "Patient" VALUES ("7", "NULL");
INSERT INTO "Laboratory" VALUES ("1", "2023-04-01", "5.5");
INSERT INTO "Laboratory" VALUES ("2", "2023-04-02", "9.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-04-03", "7.9");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-04", "8.1");
INSERT INTO "Laboratory" VALUES ("6", "2023-04-05", "3.2");
INSERT INTO "Laboratory" VALUES ("7", "2023-04-06", "7.5");
INSERT INTO "Examination" VALUES ("12.5", "7.8", "10");
INSERT INTO "Examination" VALUES ("8.0", "6.5", "5");
INSERT INTO "Examination" VALUES ("15.0", "9.0", "7");
INSERT INTO "Examination" VALUES ("10.0", "5.0", "8");
INSERT INTO "Examination" VALUES ("7.0", "4.0", "6");
INSERT INTO "Examination" VALUES ("9.0", "3.0", "4");
INSERT INTO "Examination" VALUES ("11.0", "2.0", "3");