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 "Professionals" (
"professional_id" INT UNIQUE,
"role_code" VARCHAR(10),
"first_name" VARCHAR(50),
PRIMARY KEY ("professional_id")
);

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),
"cost_of_treatment" DECIMAL(19, 4),
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("professional_id") REFERENCES "Professionals"("professional_id"),
FOREIGN KEY ("treatment_type_code") REFERENCES "Treatment_Types"("treatment_type_code")
);





INSERT INTO "Professionals" VALUES ("1", "VET", "Alice");
INSERT INTO "Professionals" VALUES ("2", "TRAINER", "Bob");
INSERT INTO "Professionals" VALUES ("3", "GROOMER", "Charlie");
INSERT INTO "Professionals" VALUES ("4", "VET", "David");
INSERT INTO "Professionals" VALUES ("5", "TRAINER", "Eve");
INSERT INTO "Professionals" VALUES ("6", "VET", "Frank");
INSERT INTO "Treatment_Types" VALUES ("VACC", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("CHECKUP", "Annual Check-up");
INSERT INTO "Treatment_Types" VALUES ("GROOM", "Full Grooming");
INSERT INTO "Treatment_Types" VALUES ("TRAIN", "Obedience Training");
INSERT INTO "Treatment_Types" VALUES ("SURG", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("DENTAL", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("1", "101", "1", "VACC", "50.00");
INSERT INTO "Treatments" VALUES ("2", "102", "2", "TRAIN", "150.00");
INSERT INTO "Treatments" VALUES ("3", "103", "3", "GROOM", "75.00");
INSERT INTO "Treatments" VALUES ("4", "101", "4", "CHECKUP", "80.00");
INSERT INTO "Treatments" VALUES ("5", "104", "1", "SURG", "500.00");
INSERT INTO "Treatments" VALUES ("6", "105", "5", "TRAIN", "200.00");
INSERT INTO "Treatments" VALUES ("7", "102", "3", "GROOM", "80.00");
INSERT INTO "Treatments" VALUES ("8", "106", "4", "VACC", "55.00");
INSERT INTO "Treatments" VALUES ("9", "107", "1", "DENTAL", "120.00");
INSERT INTO "Treatments" VALUES ("10", "108", "6", "CHECKUP", "90.00");
INSERT INTO "Treatments" VALUES ("11", "109", "2", "TRAIN", "180.00");
INSERT INTO "Treatments" VALUES ("12", "110", "3", "GROOM", "70.00");
INSERT INTO "Treatments" VALUES ("13", "101", "6", "VACC", "50.00");