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

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

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



INSERT INTO "Examination" VALUES ("Thrombosis");
INSERT INTO "Examination" VALUES ("No Thrombosis");
INSERT INTO "Examination" VALUES ("Suspected Thrombosis");
INSERT INTO "Examination" VALUES ("Other Condition");
INSERT INTO "Examination" VALUES ("Healthy");
INSERT INTO "Patient" VALUES ("1", "M", "1960-05-15", "1990-01-01");
INSERT INTO "Patient" VALUES ("2", "F", "1975-11-20", "1992-03-10");
INSERT INTO "Patient" VALUES ("3", "M", "1980-01-01", "1995-07-01");
INSERT INTO "Patient" VALUES ("4", "F", "1965-03-25", "1991-05-01");
INSERT INTO "Patient" VALUES ("5", "M", "1970-09-10", "1993-02-15");
INSERT INTO "Patient" VALUES ("6", "F", "1955-07-07", "1989-11-11");
INSERT INTO "Patient" VALUES ("7", "M", "1985-12-12", "2000-01-01");
INSERT INTO "Patient" VALUES ("8", "F", "1962-02-29", "1990-06-01");
INSERT INTO "Laboratory" VALUES ("1", "1990-02-01", "7.2");
INSERT INTO "Laboratory" VALUES ("1", "1991-10-21", "8.4");
INSERT INTO "Laboratory" VALUES ("2", "1992-04-01", "6.8");
INSERT INTO "Laboratory" VALUES ("3", "1995-08-01", "7.5");
INSERT INTO "Laboratory" VALUES ("4", "1991-10-21", "8.4");
INSERT INTO "Laboratory" VALUES ("4", "1992-01-15", "7.9");
INSERT INTO "Laboratory" VALUES ("5", "1993-03-01", "6.5");
INSERT INTO "Laboratory" VALUES ("6", "1989-12-01", "9.1");
INSERT INTO "Laboratory" VALUES ("1", "1991-05-01", "7.0");
INSERT INTO "Laboratory" VALUES ("2", "1993-01-01", "8.4");
INSERT INTO "Laboratory" VALUES ("7", "2000-02-01", "7.1");
INSERT INTO "Laboratory" VALUES ("8", "1990-07-01", "8.4");
INSERT INTO "Laboratory" VALUES ("8", "1991-10-21", "7.8");