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),
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),
"cost_of_treatment" DECIMAL(19, 4),
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", "Labrador");
INSERT INTO "Dogs" VALUES ("102", "1", "Beagle");
INSERT INTO "Dogs" VALUES ("103", "2", "Poodle");
INSERT INTO "Dogs" VALUES ("104", "3", "Bulldog");
INSERT INTO "Dogs" VALUES ("105", "3", "Boxer");
INSERT INTO "Dogs" VALUES ("106", "4", "Dachshund");
INSERT INTO "Dogs" VALUES ("107", "5", "Chihuahua");
INSERT INTO "Dogs" VALUES ("108", "5", "Pug");
INSERT INTO "Treatments" VALUES ("201", "101", "Vaccination", "150.00");
INSERT INTO "Treatments" VALUES ("202", "101", "Surgery", "1200.00");
INSERT INTO "Treatments" VALUES ("203", "102", "Checkup", "80.00");
INSERT INTO "Treatments" VALUES ("204", "103", "Dental", "300.00");
INSERT INTO "Treatments" VALUES ("205", "104", "Surgery", "1100.00");
INSERT INTO "Treatments" VALUES ("206", "105", "Vaccination", "200.00");
INSERT INTO "Treatments" VALUES ("207", "105", "Checkup", "90.00");
INSERT INTO "Treatments" VALUES ("208", "106", "Dental", "250.00");
INSERT INTO "Treatments" VALUES ("209", "107", "Surgery", "1300.00");
INSERT INTO "Treatments" VALUES ("210", "108", "Vaccination", "180.00");
INSERT INTO "Treatments" VALUES ("211", "108", "Checkup", "75.00");
INSERT INTO "Treatments" VALUES ("212", "102", "Surgery", "900.00");
INSERT INTO "Treatments" VALUES ("213", "103", "Vaccination", "160.00");
INSERT INTO "Treatments" VALUES ("214", "104", "Checkup", "85.00");
INSERT INTO "Treatments" VALUES ("215", "106", "Surgery", "1150.00");