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

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"CRP" TEXT,
PRIMARY KEY ("ID", "Date")
);

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



INSERT INTO "Patient" VALUES ("1", "M", "1994-12-01", "-", "Behcet");
INSERT INTO "Patient" VALUES ("2", "M", "1995-06-15", "Hospital A", "Behcet");
INSERT INTO "Patient" VALUES ("3", "F", "1996-03-20", "-", "Behcet");
INSERT INTO "Patient" VALUES ("4", "M", "1997-01-10", "-", "Other");
INSERT INTO "Patient" VALUES ("5", "M", "1995-11-05", "-", "Behcet");
INSERT INTO "Patient" VALUES ("6", "M", "1998-07-22", "-", "Behcet");
INSERT INTO "Patient" VALUES ("7", "M", "1996-09-30", "-", "Behcet");
INSERT INTO "Patient" VALUES ("8", "M", "1995-04-12", "Hospital B", "Behcet");
INSERT INTO "Patient" VALUES ("9", "M", "1996-12-01", "-", "Behcet");
INSERT INTO "Patient" VALUES ("10", "F", "1995-05-05", "-", "Behcet");
INSERT INTO "Examination" VALUES ("1", "1995-01-10", "Behcet", "1");
INSERT INTO "Examination" VALUES ("2", "1996-07-20", "Behcet", "0");
INSERT INTO "Examination" VALUES ("3", "1995-12-15", "Behcet", "1");
INSERT INTO "Examination" VALUES ("4", "1995-05-05", "Other", "0");
INSERT INTO "Examination" VALUES ("5", "1997-03-10", "Behcet", "1");
INSERT INTO "Examination" VALUES ("6", "1998-08-01", "Behcet", "0");
INSERT INTO "Examination" VALUES ("7", "1996-11-25", "Behcet", "1");
INSERT INTO "Examination" VALUES ("8", "1995-09-30", "Behcet", "0");
INSERT INTO "Examination" VALUES ("9", "1996-06-15", "Behcet", "1");
INSERT INTO "Examination" VALUES ("10", "1995-07-07", "Behcet", "0");
INSERT INTO "Laboratory" VALUES ("1", "1995-01-10", "5.2");
INSERT INTO "Laboratory" VALUES ("2", "1996-07-20", "3.8");
INSERT INTO "Laboratory" VALUES ("3", "1995-12-15", "4.1");
INSERT INTO "Laboratory" VALUES ("4", "1995-05-05", "2.9");
INSERT INTO "Laboratory" VALUES ("5", "1997-03-10", "6.0");
INSERT INTO "Laboratory" VALUES ("6", "1998-08-01", "3.3");
INSERT INTO "Laboratory" VALUES ("7", "1996-11-25", "5.5");
INSERT INTO "Laboratory" VALUES ("8", "1995-09-30", "4.7");
INSERT INTO "Laboratory" VALUES ("9", "1996-06-15", "5.0");
INSERT INTO "Laboratory" VALUES ("10", "1995-07-07", "3.9");