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,
"zip_code" VARCHAR(20),
PRIMARY KEY ("owner_id")
);

CREATE TABLE "Professionals" (
"professional_id" INT UNIQUE,
PRIMARY KEY ("professional_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", "12345");
INSERT INTO "Owners" VALUES ("2", "23456");
INSERT INTO "Owners" VALUES ("3", "34567");
INSERT INTO "Owners" VALUES ("4", "45678");
INSERT INTO "Owners" VALUES ("5", "56789");
INSERT INTO "Dogs" VALUES ("101", "1", "BC001");
INSERT INTO "Dogs" VALUES ("102", "1", "BC002");
INSERT INTO "Dogs" VALUES ("103", "2", "BC001");
INSERT INTO "Dogs" VALUES ("104", "3", "BC003");
INSERT INTO "Dogs" VALUES ("105", "3", "BC002");
INSERT INTO "Dogs" VALUES ("106", "4", "BC004");
INSERT INTO "Dogs" VALUES ("107", "5", "BC005");
INSERT INTO "Professionals" VALUES ("201");
INSERT INTO "Professionals" VALUES ("202");
INSERT INTO "Professionals" VALUES ("203");
INSERT INTO "Treatments" VALUES ("301", "101", "TT01", "150.00");
INSERT INTO "Treatments" VALUES ("302", "101", "TT02", "200.00");
INSERT INTO "Treatments" VALUES ("303", "102", "TT01", "100.00");
INSERT INTO "Treatments" VALUES ("304", "103", "TT03", "50.00");
INSERT INTO "Treatments" VALUES ("305", "104", "TT02", "300.00");
INSERT INTO "Treatments" VALUES ("306", "105", "TT01", "250.00");
INSERT INTO "Treatments" VALUES ("307", "105", "TT03", "100.00");
INSERT INTO "Treatments" VALUES ("308", "106", "TT02", "400.00");
INSERT INTO "Treatments" VALUES ("309", "107", "TT01", "50.00");
INSERT INTO "Treatments" VALUES ("310", "107", "TT03", "75.00");
INSERT INTO "Treatments" VALUES ("311", "107", "TT02", "125.00");