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 "Breeds" (
"breed_code" VARCHAR(10),
"breed_name" VARCHAR(80),
PRIMARY KEY ("breed_code")
);

CREATE TABLE "Dogs" (
"dog_id" INT UNIQUE,
"age" VARCHAR(20),
"date_of_birth" DATETIME,
PRIMARY KEY ("dog_id")
);

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





INSERT INTO "Breeds" VALUES ("BD001", "Labrador Retriever");
INSERT INTO "Breeds" VALUES ("BD002", "German Shepherd");
INSERT INTO "Breeds" VALUES ("BD003", "Beagle");
INSERT INTO "Breeds" VALUES ("BD004", "Bulldog");
INSERT INTO "Breeds" VALUES ("BD005", "Poodle");
INSERT INTO "Dogs" VALUES ("1", "5", "2018-06-15");
INSERT INTO "Dogs" VALUES ("2", "3", "2020-04-20");
INSERT INTO "Dogs" VALUES ("3", "7", "2016-01-10");
INSERT INTO "Dogs" VALUES ("4", "unknown", "2019-11-05");
INSERT INTO "Dogs" VALUES ("5", "2", "2021-08-30");
INSERT INTO "Dogs" VALUES ("6", "4 years", "2019-02-14");
INSERT INTO "Dogs" VALUES ("7", "6", "2017-07-22");
INSERT INTO "Dogs" VALUES ("8", "N/A", "2022-01-01");
INSERT INTO "Dogs" VALUES ("9", "8", "2015-03-03");
INSERT INTO "Dogs" VALUES ("10", "3", "2020-12-12");
INSERT INTO "Treatments" VALUES ("101", "1", "150.00");
INSERT INTO "Treatments" VALUES ("102", "2", "200.50");
INSERT INTO "Treatments" VALUES ("103", "3", "175.75");
INSERT INTO "Treatments" VALUES ("104", "5", "100.00");
INSERT INTO "Treatments" VALUES ("105", "6", "120.00");
INSERT INTO "Treatments" VALUES ("106", "7", "130.00");
INSERT INTO "Treatments" VALUES ("107", "9", "160.00");
INSERT INTO "Treatments" VALUES ("108", "10", "110.00");