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 ("VAX", "Vaccination for common diseases");
INSERT INTO "Treatment_Types" VALUES ("DENT", "Dental cleaning and care");
INSERT INTO "Treatment_Types" VALUES ("SURG", "Surgical procedure");
INSERT INTO "Treatment_Types" VALUES ("CHK", "General health check-up");
INSERT INTO "Treatment_Types" VALUES ("DERM", "Dermatology treatment for skin conditions");
INSERT INTO "Treatment_Types" VALUES ("PHYS", "Physical therapy and rehabilitation");
INSERT INTO "Treatment_Types" VALUES ("EMER", "Emergency treatment");
INSERT INTO "Treatments" VALUES ("101", "1", "201", "VAX", "2024-01-15 09:30:00", "75.00");
INSERT INTO "Treatments" VALUES ("102", "2", "202", "DENT", "2024-02-10 14:00:00", "150.50");
INSERT INTO "Treatments" VALUES ("103", "3", "203", "SURG", "2024-03-05 08:00:00", "1200.00");
INSERT INTO "Treatments" VALUES ("104", "1", "204", "CHK", "2024-01-20 10:15:00", "50.00");
INSERT INTO "Treatments" VALUES ("105", "4", "201", "DERM", "2024-04-12 11:45:00", "200.75");
INSERT INTO "Treatments" VALUES ("106", "5", "205", "PHYS", "2024-05-01 13:30:00", "300.00");
INSERT INTO "Treatments" VALUES ("107", "2", "202", "VAX", "2024-02-15 09:00:00", "75.00");
INSERT INTO "Treatments" VALUES ("108", "3", "203", "EMER", "2024-03-06 22:00:00", "500.00");
INSERT INTO "Treatments" VALUES ("109", "6", "206", "CHK", "2024-06-10 15:00:00", "50.00");
INSERT INTO "Treatments" VALUES ("110", "7", "207", "DENT", "2024-06-15 16:30:00", "160.00");
INSERT INTO "Treatments" VALUES ("111", "8", "208", "SURG", "2024-06-20 07:45:00", "1300.00");
INSERT INTO "Treatments" VALUES ("112", "9", "209", "DERM", "2024-06-25 12:00:00", "210.00");
INSERT INTO "Treatments" VALUES ("113", "10", "210", "PHYS", "2024-06-30 14:15:00", "320.00");
INSERT INTO "Treatments" VALUES ("114", "1", "201", "EMER", "2024-01-18 23:30:00", "450.00");
INSERT INTO "Treatments" VALUES ("115", "4", "204", "VAX", "2024-04-15 10:00:00", "75.00");