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" (
"LAC" TEXT
);

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

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



INSERT INTO "Patient" VALUES ("1", "F", "1950-05-20", "2023-01-10");
INSERT INTO "Patient" VALUES ("2", "M", "1940-11-15", "2023-02-12");
INSERT INTO "Patient" VALUES ("3", "F", "1965-07-30", "2023-03-05");
INSERT INTO "Patient" VALUES ("4", "F", "1930-01-01", "2023-01-20");
INSERT INTO "Patient" VALUES ("5", "M", "1958-09-10", "2023-02-25");
INSERT INTO "Patient" VALUES ("6", "F", "1945-12-12", "2023-03-15");
INSERT INTO "Patient" VALUES ("7", "M", "1970-06-06", "2023-01-30");
INSERT INTO "Patient" VALUES ("8", "F", "1959-04-18", "2023-02-05");
INSERT INTO "Patient" VALUES ("9", "F", "1935-08-22", "2023-03-10");
INSERT INTO "Patient" VALUES ("10", "M", "1948-03-03", "2023-01-25");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-11", "14.5", "30");
INSERT INTO "Laboratory" VALUES ("1", "2023-02-11", "13.8", "28");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-13", "15.0", "32");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-06", "13.5", "29");
INSERT INTO "Laboratory" VALUES ("4", "2023-01-21", "14.0", "31");
INSERT INTO "Laboratory" VALUES ("5", "2023-02-26", "13.9", "27");
INSERT INTO "Laboratory" VALUES ("6", "2023-03-16", "14.2", "33");
INSERT INTO "Laboratory" VALUES ("7", "2023-02-01", "13.7", "30");
INSERT INTO "Laboratory" VALUES ("8", "2023-02-06", "14.8", "29");
INSERT INTO "Laboratory" VALUES ("9", "2023-03-11", "15.1", "34");
INSERT INTO "Laboratory" VALUES ("10", "2023-01-26", "13.6", "28");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");
INSERT INTO "Examination" VALUES ("Positive");
INSERT INTO "Examination" VALUES ("Negative");