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

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"PT" FLOAT,
"FG" FLOAT,
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", "1975-05-10");
INSERT INTO "Patient" VALUES ("2", "1982-03-15");
INSERT INTO "Patient" VALUES ("3", "1990-11-22");
INSERT INTO "Patient" VALUES ("4", "1985-01-01");
INSERT INTO "Patient" VALUES ("5", "1979-07-04");
INSERT INTO "Patient" VALUES ("6", "1980-01-01");
INSERT INTO "Patient" VALUES ("7", "1988-09-30");
INSERT INTO "Patient" VALUES ("8", "1995-02-14");
INSERT INTO "Patient" VALUES ("9", "1981-06-20");
INSERT INTO "Patient" VALUES ("10", "1983-12-05");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "12.5", "250.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-01-10", "11.0", "500.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-01-15", "13.0", "100.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-20", "10.5", "300.0");
INSERT INTO "Laboratory" VALUES ("5", "2023-01-25", "14.0", "400.0");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-01", "11.2", "120.0");
INSERT INTO "Laboratory" VALUES ("3", "2023-02-05", "12.8", "600.0");
INSERT INTO "Laboratory" VALUES ("7", "2023-03-01", "10.8", "550.0");
INSERT INTO "Laboratory" VALUES ("8", "2023-03-05", "11.5", "140.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-03-10", "12.0", "480.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-03-15", "10.0", "130.0");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-01", "10.7", "160.0");
INSERT INTO "Laboratory" VALUES ("9", "2023-04-05", "12.1", "100.0");
INSERT INTO "Laboratory" VALUES ("10", "2023-04-10", "10.2", "500.0");
INSERT INTO "Laboratory" VALUES ("6", "2023-04-15", "11.8", "200.0");
INSERT INTO "Examination" VALUES ("2023-01-10", "0");
INSERT INTO "Examination" VALUES ("2023-01-10", "1");
INSERT INTO "Examination" VALUES ("2023-01-15", "0");
INSERT INTO "Examination" VALUES ("2023-01-20", "0");
INSERT INTO "Examination" VALUES ("2023-01-25", "0");
INSERT INTO "Examination" VALUES ("2023-02-01", "0");
INSERT INTO "Examination" VALUES ("2023-02-05", "1");
INSERT INTO "Examination" VALUES ("2023-03-01", "1");
INSERT INTO "Examination" VALUES ("2023-03-05", "0");
INSERT INTO "Examination" VALUES ("2023-03-10", "1");
INSERT INTO "Examination" VALUES ("2023-03-15", "0");
INSERT INTO "Examination" VALUES ("2023-04-01", "0");
INSERT INTO "Examination" VALUES ("2023-04-05", "0");
INSERT INTO "Examination" VALUES ("2023-04-10", "1");
INSERT INTO "Examination" VALUES ("2023-04-15", "0");