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

CREATE TABLE "Professionals" (
"professional_id" INT UNIQUE,
"role_code" VARCHAR(10),
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,
"dog_id" INT,
"professional_id" INT,
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("dog_id") REFERENCES "Dogs"("dog_id"),
FOREIGN KEY ("professional_id") REFERENCES "Professionals"("professional_id")
);





INSERT INTO "Dogs" VALUES ("1", "BC01");
INSERT INTO "Dogs" VALUES ("2", "BC02");
INSERT INTO "Dogs" VALUES ("3", "BC03");
INSERT INTO "Dogs" VALUES ("4", "BC01");
INSERT INTO "Dogs" VALUES ("5", "BC04");
INSERT INTO "Dogs" VALUES ("6", "BC05");
INSERT INTO "Dogs" VALUES ("7", "BC02");
INSERT INTO "Dogs" VALUES ("8", "BC06");
INSERT INTO "Dogs" VALUES ("9", "BC07");
INSERT INTO "Dogs" VALUES ("10", "BC08");
INSERT INTO "Professionals" VALUES ("101", "ROLE01");
INSERT INTO "Professionals" VALUES ("102", "ROLE02");
INSERT INTO "Professionals" VALUES ("103", "ROLE03");
INSERT INTO "Professionals" VALUES ("104", "ROLE01");
INSERT INTO "Professionals" VALUES ("105", "ROLE04");
INSERT INTO "Professionals" VALUES ("106", "ROLE05");
INSERT INTO "Professionals" VALUES ("107", "ROLE02");
INSERT INTO "Professionals" VALUES ("108", "ROLE06");
INSERT INTO "Professionals" VALUES ("109", "ROLE07");
INSERT INTO "Professionals" VALUES ("110", "ROLE08");
INSERT INTO "Treatment_Types" VALUES ("TT01", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("TT02", "Deworming");
INSERT INTO "Treatment_Types" VALUES ("TT03", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("TT04", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("TT05", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("1001", "1", "101");
INSERT INTO "Treatments" VALUES ("1002", "2", "102");
INSERT INTO "Treatments" VALUES ("1003", "3", "103");
INSERT INTO "Treatments" VALUES ("1004", "4", "101");
INSERT INTO "Treatments" VALUES ("1005", "5", "104");
INSERT INTO "Treatments" VALUES ("1006", "6", "105");
INSERT INTO "Treatments" VALUES ("1007", "7", "106");
INSERT INTO "Treatments" VALUES ("1008", "8", "107");
INSERT INTO "Treatments" VALUES ("1009", "9", "108");
INSERT INTO "Treatments" VALUES ("1010", "10", "109");
INSERT INTO "Treatments" VALUES ("1011", "1", "110");
INSERT INTO "Treatments" VALUES ("1012", "2", "101");
INSERT INTO "Treatments" VALUES ("1013", "3", "102");
INSERT INTO "Treatments" VALUES ("1014", "4", "103");
INSERT INTO "Treatments" VALUES ("1015", "5", "104");
INSERT INTO "Treatments" VALUES ("1016", "6", "105");
INSERT INTO "Treatments" VALUES ("1017", "7", "106");
INSERT INTO "Treatments" VALUES ("1018", "8", "107");
INSERT INTO "Treatments" VALUES ("1019", "9", "108");
INSERT INTO "Treatments" VALUES ("1020", "10", "109");