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

CREATE TABLE "Owners" (
"owner_id" INT,
"email_address" VARCHAR(50),
PRIMARY KEY ("owner_id")
);

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





INSERT INTO "Owners" VALUES ("1", "owner1@example.com");
INSERT INTO "Owners" VALUES ("2", "owner2@example.com");
INSERT INTO "Owners" VALUES ("3", "owner3@example.com");
INSERT INTO "Owners" VALUES ("4", "owner4@example.com");
INSERT INTO "Owners" VALUES ("5", "owner5@example.com");
INSERT INTO "Dogs" VALUES ("101", "1", "BRD001", "Buddy");
INSERT INTO "Dogs" VALUES ("102", "1", "BRD002", "Max");
INSERT INTO "Dogs" VALUES ("103", "2", "BRD001", "Bella");
INSERT INTO "Dogs" VALUES ("104", "3", "BRD003", "Charlie");
INSERT INTO "Dogs" VALUES ("105", "3", "BRD004", "Lucy");
INSERT INTO "Dogs" VALUES ("106", "4", "BRD002", "Daisy");
INSERT INTO "Dogs" VALUES ("107", "5", "BRD005", "Molly");
INSERT INTO "Dogs" VALUES ("108", "5", "BRD001", "Bailey");
INSERT INTO "Dogs" VALUES ("109", "2", "BRD006", "Rocky");
INSERT INTO "Dogs" VALUES ("110", "4", "BRD007", "Lola");
INSERT INTO "Treatments" VALUES ("201", "101", "T001", "250.00");
INSERT INTO "Treatments" VALUES ("202", "101", "T002", "300.00");
INSERT INTO "Treatments" VALUES ("203", "102", "T001", "1200.00");
INSERT INTO "Treatments" VALUES ("204", "103", "T003", "400.00");
INSERT INTO "Treatments" VALUES ("205", "103", "T004", "500.00");
INSERT INTO "Treatments" VALUES ("206", "104", "T002", "1000.00");
INSERT INTO "Treatments" VALUES ("207", "105", "T001", "50.00");
INSERT INTO "Treatments" VALUES ("208", "106", "T005", "999.99");
INSERT INTO "Treatments" VALUES ("209", "107", "T001", "1001.00");
INSERT INTO "Treatments" VALUES ("210", "108", "T006", "0.00");
INSERT INTO "Treatments" VALUES ("211", "109", "T002", "1000.01");
INSERT INTO "Treatments" VALUES ("212", "110", "T003", "1000.00");