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,
"Examination Date" DATE,
"aCL IgG" FLOAT,
"Diagnosis" TEXT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
"Birthday" DATE,
"Admission" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "1970-05-10", "+");
INSERT INTO "Patient" VALUES ("2", "1985-11-20", "-");
INSERT INTO "Patient" VALUES ("3", "1965-03-15", "+");
INSERT INTO "Patient" VALUES ("4", "1990-01-01", "+");
INSERT INTO "Patient" VALUES ("5", "1950-07-25", "+");
INSERT INTO "Patient" VALUES ("6", "1972-09-30", "-");
INSERT INTO "Patient" VALUES ("7", "1960-02-14", "+");
INSERT INTO "Patient" VALUES ("8", "1980-04-05", "+");
INSERT INTO "Patient" VALUES ("9", "1955-12-12", "+");
INSERT INTO "Patient" VALUES ("10", "1995-06-18", "-");
INSERT INTO "Examination" VALUES ("1", "2023-01-15", "15.2", "Thrombosis");
INSERT INTO "Examination" VALUES ("2", "2023-01-16", "8.1", "Normal");
INSERT INTO "Examination" VALUES ("3", "2023-01-17", "22.5", "Thrombosis");
INSERT INTO "Examination" VALUES ("4", "2023-01-18", "5.0", "Normal");
INSERT INTO "Examination" VALUES ("5", "2023-01-19", "30.0", "Thrombosis");
INSERT INTO "Examination" VALUES ("6", "2023-01-20", "7.5", "Normal");
INSERT INTO "Examination" VALUES ("7", "2023-01-21", "25.8", "Thrombosis");
INSERT INTO "Examination" VALUES ("8", "2023-01-22", "6.2", "Normal");
INSERT INTO "Examination" VALUES ("9", "2023-01-23", "18.9", "Thrombosis");
INSERT INTO "Examination" VALUES ("1", "2023-02-01", "16.0", "Thrombosis");
INSERT INTO "Examination" VALUES ("3", "2023-02-02", "23.0", "Thrombosis");
INSERT INTO "Examination" VALUES ("5", "2023-02-03", "31.0", "Thrombosis");
INSERT INTO "Examination" VALUES ("7", "2023-02-04", "26.0", "Thrombosis");
INSERT INTO "Examination" VALUES ("9", "2023-02-05", "19.0", "Thrombosis");