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 "Treatment_Types" (
"treatment_type_code" VARCHAR(10) UNIQUE,
"treatment_type_description" VARCHAR(80),
PRIMARY KEY ("treatment_type_code")
);

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





INSERT INTO "Treatment_Types" VALUES ("VAX01", "Rabies Vaccination");
INSERT INTO "Treatment_Types" VALUES ("CHKUP", "General Health Checkup");
INSERT INTO "Treatment_Types" VALUES ("DENTL", "Dental Cleaning");
INSERT INTO "Treatment_Types" VALUES ("SURG1", "Minor Surgery");
INSERT INTO "Treatment_Types" VALUES ("FLEA1", "Flea and Tick Treatment");
INSERT INTO "Treatment_Types" VALUES ("NUTR1", "Nutritional Consultation");
INSERT INTO "Treatment_Types" VALUES ("PHYS1", "Physical Therapy");
INSERT INTO "Treatment_Types" VALUES ("EMERG", "Emergency Treatment");
INSERT INTO "Treatments" VALUES ("101", "1", "201", "VAX01", "2024-01-15 10:30:00", "75.00");
INSERT INTO "Treatments" VALUES ("102", "2", "202", "CHKUP", "2024-01-16 09:00:00", "50.00");
INSERT INTO "Treatments" VALUES ("103", "3", "203", "DENTL", "2024-01-17 14:00:00", "150.00");
INSERT INTO "Treatments" VALUES ("104", "1", "204", "SURG1", "2024-01-18 11:00:00", "500.00");
INSERT INTO "Treatments" VALUES ("105", "4", "201", "FLEA1", "2024-01-19 15:30:00", "40.00");
INSERT INTO "Treatments" VALUES ("106", "5", "202", "NUTR1", "2024-01-20 13:00:00", "60.00");
INSERT INTO "Treatments" VALUES ("107", "2", "203", "PHYS1", "2024-01-21 10:00:00", "120.00");
INSERT INTO "Treatments" VALUES ("108", "3", "204", "EMERG", "2024-01-22 22:00:00", "1000.00");
INSERT INTO "Treatments" VALUES ("109", "6", "201", "VAX01", "2024-01-23 09:30:00", "75.00");
INSERT INTO "Treatments" VALUES ("110", "7", "202", "CHKUP", "2024-01-24 08:45:00", "50.00");
INSERT INTO "Treatments" VALUES ("111", "8", "203", "DENTL", "2024-01-25 14:15:00", "150.00");
INSERT INTO "Treatments" VALUES ("112", "9", "204", "SURG1", "2024-01-26 12:00:00", "500.00");
INSERT INTO "Treatments" VALUES ("113", "10", "201", "FLEA1", "2024-01-27 16:00:00", "40.00");
INSERT INTO "Treatments" VALUES ("114", "11", "202", "NUTR1", "2024-01-28 13:30:00", "60.00");
INSERT INTO "Treatments" VALUES ("115", "12", "203", "PHYS1", "2024-01-29 11:00:00", "120.00");
INSERT INTO "Treatments" VALUES ("116", "13", "204", "EMERG", "2024-01-30 23:00:00", "1000.00");
INSERT INTO "Treatments" VALUES ("117", "14", "201", "VAX01", "2024-01-31 10:00:00", "75.00");
INSERT INTO "Treatments" VALUES ("118", "15", "202", "CHKUP", "2024-02-01 09:15:00", "50.00");
INSERT INTO "Treatments" VALUES ("119", "16", "203", "DENTL", "2024-02-02 14:30:00", "150.00");
INSERT INTO "Treatments" VALUES ("120", "17", "204", "SURG1", "2024-02-03 12:30:00", "500.00");