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,
"name" VARCHAR(50),
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", "Buddy");
INSERT INTO "Dogs" VALUES ("2", "Lucy");
INSERT INTO "Dogs" VALUES ("3", "Max");
INSERT INTO "Dogs" VALUES ("4", "Daisy");
INSERT INTO "Dogs" VALUES ("5", "Charlie");
INSERT INTO "Dogs" VALUES ("6", "Bella");
INSERT INTO "Dogs" VALUES ("7", "Rocky");
INSERT INTO "Dogs" VALUES ("8", "Luna");
INSERT INTO "Dogs" VALUES ("9", "Cooper");
INSERT INTO "Dogs" VALUES ("10", "Zoe");
INSERT INTO "Professionals" VALUES ("101", "VET");
INSERT INTO "Professionals" VALUES ("102", "GROOMER");
INSERT INTO "Professionals" VALUES ("103", "TRAINER");
INSERT INTO "Professionals" VALUES ("104", "VET");
INSERT INTO "Professionals" VALUES ("105", "GROOMER");
INSERT INTO "Professionals" VALUES ("106", "TRAINER");
INSERT INTO "Professionals" VALUES ("107", "ASSISTANT");
INSERT INTO "Professionals" VALUES ("108", "VET");
INSERT INTO "Professionals" VALUES ("109", "GROOMER");
INSERT INTO "Professionals" VALUES ("110", "TRAINER");
INSERT INTO "Treatment_Types" VALUES ("VACC", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("GROOM", "Grooming Session");
INSERT INTO "Treatment_Types" VALUES ("TRAIN", "Obedience Training");
INSERT INTO "Treatment_Types" VALUES ("CHECKUP", "General Check-up");
INSERT INTO "Treatment_Types" VALUES ("SURG", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("DENTAL", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("1", "1", "101");
INSERT INTO "Treatments" VALUES ("2", "2", "102");
INSERT INTO "Treatments" VALUES ("3", "3", "103");
INSERT INTO "Treatments" VALUES ("4", "1", "104");
INSERT INTO "Treatments" VALUES ("5", "4", "101");
INSERT INTO "Treatments" VALUES ("6", "5", "105");
INSERT INTO "Treatments" VALUES ("7", "6", "106");
INSERT INTO "Treatments" VALUES ("8", "7", "108");
INSERT INTO "Treatments" VALUES ("9", "8", "102");
INSERT INTO "Treatments" VALUES ("10", "9", "103");
INSERT INTO "Treatments" VALUES ("11", "10", "104");
INSERT INTO "Treatments" VALUES ("12", "1", "108");
INSERT INTO "Treatments" VALUES ("13", "2", "109");
INSERT INTO "Treatments" VALUES ("14", "3", "110");
INSERT INTO "Treatments" VALUES ("15", "4", "101");
INSERT INTO "Treatments" VALUES ("16", "5", "105");
INSERT INTO "Treatments" VALUES ("17", "6", "106");
INSERT INTO "Treatments" VALUES ("18", "7", "108");
INSERT INTO "Treatments" VALUES ("19", "8", "109");
INSERT INTO "Treatments" VALUES ("20", "9", "110");
INSERT INTO "Treatments" VALUES ("21", "10", "101");