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,
"name" VARCHAR(50),
PRIMARY KEY ("dog_id"),
FOREIGN KEY ("owner_id") REFERENCES "Owners"("owner_id")
);

CREATE TABLE "Owners" (
"owner_id" INT UNIQUE,
PRIMARY KEY ("owner_id")
);

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





INSERT INTO "Owners" VALUES ("1");
INSERT INTO "Owners" VALUES ("2");
INSERT INTO "Owners" VALUES ("3");
INSERT INTO "Owners" VALUES ("4");
INSERT INTO "Owners" VALUES ("5");
INSERT INTO "Dogs" VALUES ("101", "1", "Buddy");
INSERT INTO "Dogs" VALUES ("102", "1", "Lucy");
INSERT INTO "Dogs" VALUES ("103", "2", "Max");
INSERT INTO "Dogs" VALUES ("104", "3", "Bella");
INSERT INTO "Dogs" VALUES ("105", "4", "Charlie");
INSERT INTO "Dogs" VALUES ("106", "5", "Daisy");
INSERT INTO "Dogs" VALUES ("107", "2", "Rocky");
INSERT INTO "Dogs" VALUES ("108", "3", "Luna");
INSERT INTO "Treatments" VALUES ("1", "101");
INSERT INTO "Treatments" VALUES ("2", "101");
INSERT INTO "Treatments" VALUES ("3", "103");
INSERT INTO "Treatments" VALUES ("4", "104");
INSERT INTO "Treatments" VALUES ("5", "107");