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 ("B001", "Labrador Retriever");
INSERT INTO "Breeds" VALUES ("B002", "German Shepherd");
INSERT INTO "Breeds" VALUES ("B003", "Bulldog");
INSERT INTO "Breeds" VALUES ("B004", "Beagle");
INSERT INTO "Breeds" VALUES ("B005", "Poodle");
INSERT INTO "Dogs" VALUES ("1", "5 years", "2018-04-15");
INSERT INTO "Dogs" VALUES ("2", "3 years", "2020-06-20");
INSERT INTO "Dogs" VALUES ("3", "7 years", "2016-01-10");
INSERT INTO "Dogs" VALUES ("4", "1 year", "2022-03-05");
INSERT INTO "Dogs" VALUES ("5", "10 years", "2013-11-30");
INSERT INTO "Dogs" VALUES ("6", "6 years", "2017-08-22");
INSERT INTO "Dogs" VALUES ("7", "4 years", "2019-12-01");
INSERT INTO "Dogs" VALUES ("8", "2 years", "2021-07-14");
INSERT INTO "Treatments" VALUES ("101", "1", "250.00");
INSERT INTO "Treatments" VALUES ("102", "2", "150.50");
INSERT INTO "Treatments" VALUES ("103", "3", "300.75");
INSERT INTO "Treatments" VALUES ("104", "5", "500.00");
INSERT INTO "Treatments" VALUES ("105", "6", "200.00");
INSERT INTO "Treatments" VALUES ("106", "7", "175.25");
INSERT INTO "Treatments" VALUES ("107", "7", "100.00");
INSERT INTO "Treatments" VALUES ("108", "8", "80.00");