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

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

CREATE TABLE "Treatments" (
"treatment_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 "Dogs" VALUES ("1");
INSERT INTO "Dogs" VALUES ("2");
INSERT INTO "Dogs" VALUES ("3");
INSERT INTO "Dogs" VALUES ("4");
INSERT INTO "Dogs" VALUES ("5");
INSERT INTO "Professionals" VALUES ("101", "VET", "Alice");
INSERT INTO "Professionals" VALUES ("102", "GROOM", "Bob");
INSERT INTO "Professionals" VALUES ("103", "TRAIN", "Charlie");
INSERT INTO "Professionals" VALUES ("104", "VET", "Diana");
INSERT INTO "Professionals" VALUES ("105", "GROOM", "Eve");
INSERT INTO "Treatment_Types" VALUES ("T01", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("T02", "Haircut");
INSERT INTO "Treatment_Types" VALUES ("T03", "Obedience Training");
INSERT INTO "Treatment_Types" VALUES ("T04", "Dental Cleaning");
INSERT INTO "Treatment_Types" VALUES ("T05", "Nail Clipping");
INSERT INTO "Treatments" VALUES ("201", "101", "T01");
INSERT INTO "Treatments" VALUES ("202", "101", "T04");
INSERT INTO "Treatments" VALUES ("203", "102", "T02");
INSERT INTO "Treatments" VALUES ("204", "102", "T05");
INSERT INTO "Treatments" VALUES ("205", "103", "T03");
INSERT INTO "Treatments" VALUES ("206", "104", "T01");
INSERT INTO "Treatments" VALUES ("207", "105", "T05");
INSERT INTO "Treatments" VALUES ("208", "105", "T02");
INSERT INTO "Treatments" VALUES ("209", "105", "T04");