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

CREATE TABLE "Treatment_Types" (
"treatment_type_code" VARCHAR(10),
"treatment_type_description" VARCHAR(80),
PRIMARY KEY ("treatment_type_code")
);

CREATE TABLE "Treatments" (
"treatment_id" INT,
"dog_id" INT,
"treatment_type_code" VARCHAR(10),
"date_of_treatment" DATETIME,
"cost_of_treatment" DECIMAL(19, 4),
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("dog_id") REFERENCES "Dogs"("dog_id"),
FOREIGN KEY ("treatment_type_code") REFERENCES "Treatment_Types"("treatment_type_code")
);





INSERT INTO "Dogs" VALUES ("1", "BC01");
INSERT INTO "Dogs" VALUES ("2", "BC02");
INSERT INTO "Dogs" VALUES ("3", "BC03");
INSERT INTO "Dogs" VALUES ("4", "BC04");
INSERT INTO "Dogs" VALUES ("5", "BC05");
INSERT INTO "Treatment_Types" VALUES ("TT01", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("TT02", "Deworming");
INSERT INTO "Treatment_Types" VALUES ("TT03", "Neutering");
INSERT INTO "Treatment_Types" VALUES ("TT04", "Dental Cleaning");
INSERT INTO "Treatment_Types" VALUES ("TT05", "Emergency Surgery");
INSERT INTO "Treatments" VALUES ("101", "1", "TT01", "2024-01-15 09:00:00", "45.00");
INSERT INTO "Treatments" VALUES ("102", "2", "TT02", "2024-01-20 10:30:00", "30.00");
INSERT INTO "Treatments" VALUES ("103", "3", "TT03", "2024-02-10 14:00:00", "150.00");
INSERT INTO "Treatments" VALUES ("104", "1", "TT04", "2024-02-15 11:00:00", "85.50");
INSERT INTO "Treatments" VALUES ("105", "4", "TT05", "2024-03-01 16:45:00", "1200.00");
INSERT INTO "Treatments" VALUES ("106", "5", "TT01", "2024-03-01 16:45:00", "50.00");
INSERT INTO "Treatments" VALUES ("107", "2", "TT05", "2024-03-05 09:30:00", "1100.00");
INSERT INTO "Treatments" VALUES ("108", "3", "TT02", "2024-03-10 08:00:00", "35.00");
INSERT INTO "Treatments" VALUES ("109", "4", "TT01", "2024-03-15 13:00:00", "40.00");
INSERT INTO "Treatments" VALUES ("110", "5", "TT03", "2024-03-20 15:00:00", "160.00");
INSERT INTO "Treatments" VALUES ("111", "1", "TT05", "2024-03-25 17:00:00", "1300.00");
INSERT INTO "Treatments" VALUES ("112", "2", "TT04", "2024-03-25 17:00:00", "90.00");
INSERT INTO "Treatments" VALUES ("113", "3", "TT05", "2024-03-30 12:00:00", "1250.00");
INSERT INTO "Treatments" VALUES ("114", "4", "TT02", "2024-04-01 10:00:00", "32.00");
INSERT INTO "Treatments" VALUES ("115", "5", "TT04", "2024-04-05 14:30:00", "88.00");