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", "2023-01-10");
INSERT INTO "Patient" VALUES ("2", "NULL");
INSERT INTO "Patient" VALUES ("3", "NULL");
INSERT INTO "Patient" VALUES ("4", "2022-12-05");
INSERT INTO "Patient" VALUES ("5", "NULL");
INSERT INTO "Patient" VALUES ("6", "NULL");
INSERT INTO "Patient" VALUES ("7", "2023-03-15");
INSERT INTO "Patient" VALUES ("8", "NULL");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-11", "5");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-10", "7.9");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-20", "3.5");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-25", "9.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-15", "7.5");
INSERT INTO "Laboratory" VALUES ("5", "2023-03-01", "2.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-03-05", "8.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-03-10", "7.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-04-01", "NULL");
INSERT INTO "Examination" VALUES ("12.5", "7.8", "3");
INSERT INTO "Examination" VALUES ("8.0", "5.5", "2");
INSERT INTO "Examination" VALUES ("10.0", "6.0", "4");
INSERT INTO "Examination" VALUES ("9.5", "7.0", "1");
INSERT INTO "Examination" VALUES ("11.0", "8.5", "5");
INSERT INTO "Examination" VALUES ("7.0", "4.0", "3");
INSERT INTO "Examination" VALUES ("6.5", "3.5", "2");
INSERT INTO "Examination" VALUES ("5.0", "2.0", "1");