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-01-01");
INSERT INTO "Patient" VALUES ("2", "F", "1992-12-31");
INSERT INTO "Patient" VALUES ("3", "M", "1994-06-15");
INSERT INTO "Patient" VALUES ("4", "F", "1995-11-20");
INSERT INTO "Patient" VALUES ("5", "M", "1991-05-10");
INSERT INTO "Patient" VALUES ("6", "F", "1993-12-31");
INSERT INTO "Patient" VALUES ("7", "M", "1996-07-07");
INSERT INTO "Patient" VALUES ("8", "F", "1992-01-01");
INSERT INTO "Patient" VALUES ("9", "M", "1997-03-03");
INSERT INTO "Patient" VALUES ("10", "F", "1993-08-25");
INSERT INTO "Laboratory" VALUES ("1", "1993-01-02", "13.9");
INSERT INTO "Laboratory" VALUES ("1", "1993-02-15", "14.1");
INSERT INTO "Laboratory" VALUES ("2", "1993-01-01", "13.5");
INSERT INTO "Laboratory" VALUES ("3", "1994-06-16", "14.0");
INSERT INTO "Laboratory" VALUES ("3", "1994-07-01", "13.8");
INSERT INTO "Laboratory" VALUES ("4", "1995-11-21", "12.0");
INSERT INTO "Laboratory" VALUES ("5", "1991-05-11", "13.0");
INSERT INTO "Laboratory" VALUES ("6", "1994-01-01", "14.0");
INSERT INTO "Laboratory" VALUES ("6", "1994-02-01", "13.9");
INSERT INTO "Laboratory" VALUES ("7", "1996-07-08", "15.0");
INSERT INTO "Laboratory" VALUES ("8", "1992-01-02", "13.0");
INSERT INTO "Laboratory" VALUES ("9", "1997-03-04", "13.5");
INSERT INTO "Laboratory" VALUES ("10", "1993-08-26", "14.0");
INSERT INTO "Laboratory" VALUES ("10", "1993-09-01", "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");
INSERT INTO "Examination" VALUES ("Positive", "Negative", "1");
INSERT INTO "Examination" VALUES ("Negative", "Positive", "0");