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,
"ANA" INT,
"ANA Pattern" TEXT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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

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



INSERT INTO "Patient" VALUES ("1", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "Anemia");
INSERT INTO "Patient" VALUES ("3", "Healthy");
INSERT INTO "Patient" VALUES ("4", "Thrombosis");
INSERT INTO "Patient" VALUES ("5", "Healthy");
INSERT INTO "Examination" VALUES ("1", "100", "Homogeneous");
INSERT INTO "Examination" VALUES ("2", "20", "Speckled");
INSERT INTO "Examination" VALUES ("3", "5", "Negative");
INSERT INTO "Examination" VALUES ("4", "80", "Nucleolar");
INSERT INTO "Examination" VALUES ("5", "10", "Negative");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-15", "2.5", "Positive");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-16", "1.8", "Negative");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-17", "0.9", "Negative");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-18", "1.9", "Positive");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-19", "1.5", "Negative");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-01", "1.7", "Positive");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-02", "2.1", "Negative");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-03", "0.7", "Negative");
INSERT INTO "Laboratory" VALUES ("4", "2023-02-04", "1.6", "Positive");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-05", "1.95", "Negative");