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),
"zip_code" VARCHAR(20),
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", "10001");
INSERT INTO "Owners" VALUES ("2", "Bob", "10002");
INSERT INTO "Owners" VALUES ("3", "Charlie", "10003");
INSERT INTO "Owners" VALUES ("4", "Diana", "10004");
INSERT INTO "Owners" VALUES ("5", "Eve", "10005");
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", "Chihuahua");
INSERT INTO "Dogs" VALUES ("107", "5", "Dachshund");
INSERT INTO "Dogs" VALUES ("108", "5", "Pug");
INSERT INTO "Dogs" VALUES ("109", "5", "Dalmatian");
INSERT INTO "Treatments" VALUES ("201", "101", "Vaccination", "150.00");
INSERT INTO "Treatments" VALUES ("202", "101", "Checkup", "50.00");
INSERT INTO "Treatments" VALUES ("203", "102", "Surgery", "1200.00");
INSERT INTO "Treatments" VALUES ("204", "103", "Dental", "300.00");
INSERT INTO "Treatments" VALUES ("205", "104", "Vaccination", "100.00");
INSERT INTO "Treatments" VALUES ("206", "105", "Checkup", "75.00");
INSERT INTO "Treatments" VALUES ("207", "105", "Surgery", "800.00");
INSERT INTO "Treatments" VALUES ("208", "106", "Dental", "200.00");
INSERT INTO "Treatments" VALUES ("209", "107", "Vaccination", "120.00");
INSERT INTO "Treatments" VALUES ("210", "108", "Checkup", "60.00");
INSERT INTO "Treatments" VALUES ("211", "109", "Surgery", "1300.00");
INSERT INTO "Treatments" VALUES ("212", "109", "Dental", "400.00");