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,
"Symptoms" TEXT,
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

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

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



INSERT INTO "Patient" VALUES ("1", "M", "1980-05-10", "Hypertension");
INSERT INTO "Patient" VALUES ("2", "F", "1990-03-15", "Diabetes");
INSERT INTO "Patient" VALUES ("3", "M", "1985-01-01", "Asthma");
INSERT INTO "Patient" VALUES ("4", "F", "1992-11-22", "Migraine");
INSERT INTO "Patient" VALUES ("5", "M", "1995-07-04", "Allergies");
INSERT INTO "Patient" VALUES ("6", "F", "1988-02-28", "Arthritis");
INSERT INTO "Patient" VALUES ("7", "M", "1975-09-12", "Obesity");
INSERT INTO "Patient" VALUES ("8", "F", "1991-06-01", "Anxiety");
INSERT INTO "Patient" VALUES ("9", "M", "1993-04-18", "Depression");
INSERT INTO "Patient" VALUES ("10", "F", "1986-10-05", "Thyroid Disorder");
INSERT INTO "Patient" VALUES ("11", "M", "1990-01-01", "Common Cold");
INSERT INTO "Patient" VALUES ("12", "F", "1994-08-20", "Flu");
INSERT INTO "Patient" VALUES ("13", "M", "1987-03-03", "Gout");
INSERT INTO "Patient" VALUES ("14", "F", "1996-12-12", "Pneumonia");
INSERT INTO "Patient" VALUES ("15", "M", "1989-07-07", "Bronchitis");
INSERT INTO "Laboratory" VALUES ("1", "2023-01-10", "+");
INSERT INTO "Laboratory" VALUES ("2", "2023-02-15", "-");
INSERT INTO "Laboratory" VALUES ("3", "2023-03-20", "+-");
INSERT INTO "Laboratory" VALUES ("4", "2023-04-25", "-");
INSERT INTO "Laboratory" VALUES ("5", "2023-05-30", "+-");
INSERT INTO "Laboratory" VALUES ("6", "2023-06-05", "+");
INSERT INTO "Laboratory" VALUES ("7", "2023-07-10", "+");
INSERT INTO "Laboratory" VALUES ("8", "2023-08-15", "-");
INSERT INTO "Laboratory" VALUES ("9", "2023-09-20", "+-");
INSERT INTO "Laboratory" VALUES ("10", "2023-10-25", "-");
INSERT INTO "Laboratory" VALUES ("11", "2023-11-01", "-");
INSERT INTO "Laboratory" VALUES ("12", "2023-11-05", "+-");
INSERT INTO "Laboratory" VALUES ("13", "2023-11-10", "+");
INSERT INTO "Laboratory" VALUES ("14", "2023-11-15", "-");
INSERT INTO "Laboratory" VALUES ("15", "2023-11-20", "+-");
INSERT INTO "Laboratory" VALUES ("2", "2022-01-01", "+");
INSERT INTO "Laboratory" VALUES ("4", "2022-02-01", "+");
INSERT INTO "Laboratory" VALUES ("8", "2022-03-01", "+-");
INSERT INTO "Laboratory" VALUES ("10", "2022-04-01", "-");
INSERT INTO "Laboratory" VALUES ("11", "2022-05-01", "-");
INSERT INTO "Laboratory" VALUES ("12", "2022-06-01", "+-");
INSERT INTO "Laboratory" VALUES ("14", "2022-07-01", "-");
INSERT INTO "Laboratory" VALUES ("15", "2022-08-01", "+-");
INSERT INTO "Examination" VALUES ("1", "2023-01-15", "Hypertension", "High blood pressure");
INSERT INTO "Examination" VALUES ("2", "2023-02-20", "Type 2 Diabetes", "Frequent urination");
INSERT INTO "Examination" VALUES ("3", "2023-03-25", "Allergic Asthma", "Wheezing");
INSERT INTO "Examination" VALUES ("4", "2023-04-30", "Chronic Migraine", "Severe headache");
INSERT INTO "Examination" VALUES ("5", "2023-06-01", "Seasonal Allergies", "Sneezing");
INSERT INTO "Examination" VALUES ("6", "2023-06-10", "Rheumatoid Arthritis", "Joint pain");
INSERT INTO "Examination" VALUES ("7", "2023-07-15", "Morbid Obesity", "Weight gain");
INSERT INTO "Examination" VALUES ("8", "2023-08-20", "Generalized Anxiety Disorder", "Nervousness");
INSERT INTO "Examination" VALUES ("9", "2023-09-25", "Major Depressive Disorder", "Low mood");
INSERT INTO "Examination" VALUES ("10", "2023-10-30", "Hypothyroidism", "Fatigue");
INSERT INTO "Examination" VALUES ("11", "2023-11-02", "Common Cold", "Runny nose");
INSERT INTO "Examination" VALUES ("12", "2023-11-06", "Influenza", "Fever");
INSERT INTO "Examination" VALUES ("13", "2023-11-11", "Gout", "Big toe pain");
INSERT INTO "Examination" VALUES ("14", "2023-11-16", "Bacterial Pneumonia", "Cough");
INSERT INTO "Examination" VALUES ("15", "2023-11-21", "Acute Bronchitis", "Chest congestion");
INSERT INTO "Examination" VALUES ("2", "2023-02-25", "Diabetic Neuropathy", "Numbness");
INSERT INTO "Examination" VALUES ("4", "2023-05-05", "Tension Headache", "Head pressure");
INSERT INTO "Examination" VALUES ("8", "2023-08-25", "Panic Disorder", "Palpitations");
INSERT INTO "Examination" VALUES ("10", "2023-11-01", "Hashimotos Thyroiditis", "Weight gain");
INSERT INTO "Examination" VALUES ("11", "2023-11-03", "Sinusitis", "Facial pain");
INSERT INTO "Examination" VALUES ("12", "2023-11-07", "Viral Infection", "Body aches");
INSERT INTO "Examination" VALUES ("14", "2023-11-17", "Asthma Exacerbation", "Shortness of breath");
INSERT INTO "Examination" VALUES ("15", "2023-11-22", "Chronic Cough", "Persistent cough");