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,
"last_name" VARCHAR(50),
"cell_number" VARCHAR(20),
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,
"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", "Smith", "555-1234");
INSERT INTO "Professionals" VALUES ("2", "Johnson", "555-5678");
INSERT INTO "Professionals" VALUES ("3", "Williams", "555-8765");
INSERT INTO "Professionals" VALUES ("4", "Brown", "555-4321");
INSERT INTO "Professionals" VALUES ("5", "Jones", "555-0000");
INSERT INTO "Treatment_Types" VALUES ("T01", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("T02", "Deworming");
INSERT INTO "Treatment_Types" VALUES ("T03", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("T04", "Dental Cleaning");
INSERT INTO "Treatment_Types" VALUES ("T05", "Surgery");
INSERT INTO "Treatments" VALUES ("101", "201", "1", "T01");
INSERT INTO "Treatments" VALUES ("102", "202", "1", "T02");
INSERT INTO "Treatments" VALUES ("103", "203", "2", "T01");
INSERT INTO "Treatments" VALUES ("104", "204", "2", "T01");
INSERT INTO "Treatments" VALUES ("105", "205", "3", "T03");
INSERT INTO "Treatments" VALUES ("106", "206", "3", "T04");
INSERT INTO "Treatments" VALUES ("107", "207", "3", "T05");
INSERT INTO "Treatments" VALUES ("108", "208", "4", "T02");
INSERT INTO "Treatments" VALUES ("109", "209", "4", "T02");
INSERT INTO "Treatments" VALUES ("110", "210", "5", "T05");