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" (
"RVVT" TEXT,
"LAC" TEXT,
"Thrombosis" INT
);

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

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



INSERT INTO "Patient" VALUES ("1", "M", "1993-05-10");
INSERT INTO "Patient" VALUES ("2", "F", "1991-11-23");
INSERT INTO "Patient" VALUES ("3", "F", "1995-07-15");
INSERT INTO "Patient" VALUES ("4", "M", "1992-12-31");
INSERT INTO "Patient" VALUES ("5", "F", "1994-01-01");
INSERT INTO "Patient" VALUES ("6", "M", "1996-03-20");
INSERT INTO "Patient" VALUES ("7", "F", "1990-08-05");
INSERT INTO "Patient" VALUES ("8", "M", "1997-09-10");
INSERT INTO "Laboratory" VALUES ("1", "1993-05-11", "13.5");
INSERT INTO "Laboratory" VALUES ("1", "1994-06-12", "14.2");
INSERT INTO "Laboratory" VALUES ("2", "1991-12-01", "12.8");
INSERT INTO "Laboratory" VALUES ("3", "1995-07-16", "13.9");
INSERT INTO "Laboratory" VALUES ("3", "1996-08-20", "15.0");
INSERT INTO "Laboratory" VALUES ("4", "1993-01-01", "13.0");
INSERT INTO "Laboratory" VALUES ("5", "1994-01-02", "13.8");
INSERT INTO "Laboratory" VALUES ("6", "1996-03-21", "14.5");
INSERT INTO "Laboratory" VALUES ("7", "1990-08-06", "13.2");
INSERT INTO "Laboratory" VALUES ("8", "1997-09-11", "13.7");
INSERT INTO "Examination" VALUES ("Positive", "Negative", "1");
INSERT INTO "Examination" VALUES ("Negative", "Positive", "0");
INSERT INTO "Examination" VALUES ("Positive", "Positive", "1");
INSERT INTO "Examination" VALUES ("Negative", "Negative", "0");
INSERT INTO "Examination" VALUES ("Positive", "Negative", "1");
INSERT INTO "Examination" VALUES ("Negative", "Positive", "0");
INSERT INTO "Examination" VALUES ("Positive", "Positive", "1");
INSERT INTO "Examination" VALUES ("Negative", "Negative", "0");