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),
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", "GRT", "Bob");
INSERT INTO "Professionals" VALUES ("3", "VET", "Charlie");
INSERT INTO "Professionals" VALUES ("4", "TRN", "Diana");
INSERT INTO "Professionals" VALUES ("5", "GRT", "Eve");
INSERT INTO "Professionals" VALUES ("6", "TRN", "Frank");
INSERT INTO "Treatment_Types" VALUES ("VAC", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("CHK", "Health Check");
INSERT INTO "Treatment_Types" VALUES ("GRM", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("TRN", "Training Session");
INSERT INTO "Treatment_Types" VALUES ("SUR", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("DEN", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("101", "1001", "1", "VAC");
INSERT INTO "Treatments" VALUES ("102", "1002", "2", "GRM");
INSERT INTO "Treatments" VALUES ("103", "1003", "3", "CHK");
INSERT INTO "Treatments" VALUES ("104", "1004", "4", "TRN");
INSERT INTO "Treatments" VALUES ("105", "1005", "5", "GRM");
INSERT INTO "Treatments" VALUES ("106", "1006", "1", "SUR");
INSERT INTO "Treatments" VALUES ("107", "1007", "3", "DEN");
INSERT INTO "Treatments" VALUES ("108", "1008", "6", "TRN");
INSERT INTO "Treatments" VALUES ("109", "1009", "2", "GRM");
INSERT INTO "Treatments" VALUES ("110", "1010", "5", "VAC");
INSERT INTO "Treatments" VALUES ("111", "1011", "4", "TRN");
INSERT INTO "Treatments" VALUES ("112", "1012", "1", "CHK");
INSERT INTO "Treatments" VALUES ("113", "1013", "6", "TRN");
INSERT INTO "Treatments" VALUES ("114", "1014", "3", "SUR");
INSERT INTO "Treatments" VALUES ("115", "1015", "2", "DEN");