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" (
"Examination Date" DATE,
"Diagnosis" TEXT,
"Thrombosis" INT
);

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

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



INSERT INTO "Patient" VALUES ("1", "1970-05-10");
INSERT INTO "Patient" VALUES ("2", "1980-11-20");
INSERT INTO "Patient" VALUES ("3", "1930-01-15");
INSERT INTO "Patient" VALUES ("4", "1965-03-25");
INSERT INTO "Patient" VALUES ("5", "1984-07-01");
INSERT INTO "Patient" VALUES ("6", "1975-09-12");
INSERT INTO "Patient" VALUES ("7", "1940-02-28");
INSERT INTO "Patient" VALUES ("8", "1982-04-04");
INSERT INTO "Patient" VALUES ("9", "1978-06-18");
INSERT INTO "Patient" VALUES ("10", "1950-12-01");
INSERT INTO "Laboratory" VALUES ("1", "1984-01-01", "250");
INSERT INTO "Laboratory" VALUES ("1", "1985-01-01", "150");
INSERT INTO "Laboratory" VALUES ("2", "1984-02-15", "300");
INSERT INTO "Laboratory" VALUES ("3", "1984-03-20", "120");
INSERT INTO "Laboratory" VALUES ("4", "1984-04-10", "500");
INSERT INTO "Laboratory" VALUES ("5", "1984-05-05", "180");
INSERT INTO "Laboratory" VALUES ("6", "1984-06-22", "90");
INSERT INTO "Laboratory" VALUES ("7", "1984-07-30", "350");
INSERT INTO "Laboratory" VALUES ("8", "1984-08-14", "200");
INSERT INTO "Laboratory" VALUES ("9", "1984-09-01", "450");
INSERT INTO "Laboratory" VALUES ("10", "1984-10-10", "280");
INSERT INTO "Laboratory" VALUES ("1", "1983-11-11", "220");
INSERT INTO "Laboratory" VALUES ("2", "1985-03-03", "270");
INSERT INTO "Laboratory" VALUES ("4", "1984-04-11", "110");
INSERT INTO "Laboratory" VALUES ("6", "1984-06-23", "105");
INSERT INTO "Examination" VALUES ("1984-01-01", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-02-15", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-03-20", "Thrombosis", "1");
INSERT INTO "Examination" VALUES ("1984-04-10", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-05-05", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-06-22", "Thrombosis", "1");
INSERT INTO "Examination" VALUES ("1984-07-30", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-08-14", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-09-01", "Normal", "0");
INSERT INTO "Examination" VALUES ("1984-10-10", "Normal", "0");