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 "Dogs" (
"dog_id" INT UNIQUE,
"owner_id" INT,
PRIMARY KEY ("dog_id"),
FOREIGN KEY ("owner_id") REFERENCES "Owners"("owner_id")
);

CREATE TABLE "Owners" (
"owner_id" INT UNIQUE,
"first_name" VARCHAR(50),
"last_name" VARCHAR(50),
PRIMARY KEY ("owner_id")
);

CREATE TABLE "Treatments" (
"treatment_id" INT,
"dog_id" INT,
"treatment_type_code" VARCHAR(10),
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("dog_id") REFERENCES "Dogs"("dog_id")
);





INSERT INTO "Owners" VALUES ("1", "Alice", "Smith");
INSERT INTO "Owners" VALUES ("2", "Bob", "Johnson");
INSERT INTO "Owners" VALUES ("3", "Carol", "Williams");
INSERT INTO "Owners" VALUES ("4", "David", "Brown");
INSERT INTO "Owners" VALUES ("5", "Eve", "Jones");
INSERT INTO "Dogs" VALUES ("101", "1");
INSERT INTO "Dogs" VALUES ("102", "1");
INSERT INTO "Dogs" VALUES ("103", "2");
INSERT INTO "Dogs" VALUES ("104", "3");
INSERT INTO "Dogs" VALUES ("105", "3");
INSERT INTO "Dogs" VALUES ("106", "3");
INSERT INTO "Dogs" VALUES ("107", "4");
INSERT INTO "Dogs" VALUES ("108", "5");
INSERT INTO "Treatments" VALUES ("1001", "101", "VACC");
INSERT INTO "Treatments" VALUES ("1002", "101", "CHECK");
INSERT INTO "Treatments" VALUES ("1003", "102", "VACC");
INSERT INTO "Treatments" VALUES ("1004", "102", "DENT");
INSERT INTO "Treatments" VALUES ("1005", "102", "CHECK");
INSERT INTO "Treatments" VALUES ("1006", "103", "VACC");
INSERT INTO "Treatments" VALUES ("1007", "104", "SURG");
INSERT INTO "Treatments" VALUES ("1008", "105", "VACC");
INSERT INTO "Treatments" VALUES ("1009", "105", "CHECK");
INSERT INTO "Treatments" VALUES ("1010", "106", "DENT");
INSERT INTO "Treatments" VALUES ("1011", "106", "VACC");
INSERT INTO "Treatments" VALUES ("1012", "106", "CHECK");
INSERT INTO "Treatments" VALUES ("1013", "107", "VACC");
INSERT INTO "Treatments" VALUES ("1014", "108", "CHECK");
INSERT INTO "Treatments" VALUES ("1015", "108", "VACC");
INSERT INTO "Treatments" VALUES ("1016", "108", "DENT");
INSERT INTO "Treatments" VALUES ("1017", "108", "SURG");