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

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"WBC" FLOAT,
"RBC" FLOAT,
"PLT" INT,
"FG" FLOAT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "M");
INSERT INTO "Patient" VALUES ("2", "F");
INSERT INTO "Patient" VALUES ("3", "M");
INSERT INTO "Patient" VALUES ("4", "M");
INSERT INTO "Patient" VALUES ("5", "F");
INSERT INTO "Patient" VALUES ("6", "M");
INSERT INTO "Patient" VALUES ("7", "M");
INSERT INTO "Patient" VALUES ("8", "M");
INSERT INTO "Patient" VALUES ("9", "F");
INSERT INTO "Patient" VALUES ("10", "M");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-01", "5.0", "4.5", "200000", "100.0");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-02", "6.0", "4.8", "210000", "500.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-01", "8.0", "4.2", "250000", "300.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-01", "4.0", "5.0", "180000", "120.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-02", "7.0", "4.9", "190000", "480.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-01", "3.0", "4.1", "220000", "250.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-01", "9.5", "4.3", "230000", "350.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-01-01", "5.5", "4.6", "205000", "140.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-01-02", "6.5", "4.7", "215000", "460.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-01-01", "8.5", "4.4", "240000", "160.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-01-01", "4.2", "4.0", "195000", "150.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-01-02", "4.3", "4.1", "196000", "450.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-01-01", "7.2", "4.5", "200000", "320.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-01-01", "5.8", "4.6", "210000", "130.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-01-02", "6.2", "4.7", "212000", "470.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-01-03", "6.0", "4.8", "215000", "300.0");
INSERT INTO "Examination" VALUES ("0");
INSERT INTO "Examination" VALUES ("1");
INSERT INTO "Examination" VALUES ("0");
INSERT INTO "Examination" VALUES ("1");
INSERT INTO "Examination" VALUES ("0");
INSERT INTO "Examination" VALUES ("1");
INSERT INTO "Examination" VALUES ("0");
INSERT INTO "Examination" VALUES ("1");
INSERT INTO "Examination" VALUES ("0");
INSERT INTO "Examination" VALUES ("1");