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,
"HGB" FLOAT,
"PLT" INT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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



INSERT INTO "Patient" VALUES ("1", "M", "1935-07-20");
INSERT INTO "Patient" VALUES ("2", "F", "1940-03-15");
INSERT INTO "Patient" VALUES ("3", "M", "1936-12-01");
INSERT INTO "Patient" VALUES ("4", "F", "1930-06-10");
INSERT INTO "Patient" VALUES ("5", "M", "1937-11-25");
INSERT INTO "Patient" VALUES ("6", "F", "1938-01-30");
INSERT INTO "Patient" VALUES ("7", "M", "1934-05-05");
INSERT INTO "Patient" VALUES ("8", "F", "1939-09-09");
INSERT INTO "Patient" VALUES ("9", "M", "1933-02-14");
INSERT INTO "Patient" VALUES ("10", "F", "1932-08-22");
INSERT INTO "Laboratory" VALUES ("1", "1984-01-10", "14.2", "150");
INSERT INTO "Laboratory" VALUES ("2", "1984-05-20", "13.5", "399");
INSERT INTO "Laboratory" VALUES ("3", "1984-07-15", "15.0", "100");
INSERT INTO "Laboratory" VALUES ("4", "1984-03-30", "12.8", "401");
INSERT INTO "Laboratory" VALUES ("5", "1984-11-11", "14.0", "99");
INSERT INTO "Laboratory" VALUES ("6", "1984-12-01", "13.2", "250");
INSERT INTO "Laboratory" VALUES ("7", "1984-06-25", "14.5", "400");
INSERT INTO "Laboratory" VALUES ("8", "1984-09-10", "13.8", "80");
INSERT INTO "Laboratory" VALUES ("9", "1984-04-05", "15.1", "350");
INSERT INTO "Laboratory" VALUES ("10", "1984-10-20", "12.9", "500");
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");