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

CREATE TABLE "Professionals" (
"professional_id" INT UNIQUE,
"state" VARCHAR(20),
"last_name" VARCHAR(50),
"cell_number" VARCHAR(20),
PRIMARY KEY ("professional_id")
);

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", "101", "BC01");
INSERT INTO "Dogs" VALUES ("2", "102", "BC02");
INSERT INTO "Dogs" VALUES ("3", "103", "BC03");
INSERT INTO "Dogs" VALUES ("4", "104", "BC01");
INSERT INTO "Dogs" VALUES ("5", "105", "BC04");
INSERT INTO "Dogs" VALUES ("6", "106", "BC05");
INSERT INTO "Dogs" VALUES ("7", "107", "BC02");
INSERT INTO "Dogs" VALUES ("8", "108", "BC03");
INSERT INTO "Professionals" VALUES ("201", "Indiana", "Smith", "555-1234");
INSERT INTO "Professionals" VALUES ("202", "Ohio", "Johnson", "555-2345");
INSERT INTO "Professionals" VALUES ("203", "Indiana", "Williams", "555-3456");
INSERT INTO "Professionals" VALUES ("204", "Kentucky", "Brown", "555-4567");
INSERT INTO "Professionals" VALUES ("205", "Illinois", "Jones", "555-5678");
INSERT INTO "Professionals" VALUES ("206", "Michigan", "Garcia", "555-6789");
INSERT INTO "Professionals" VALUES ("207", "Ohio", "Miller", "555-7890");
INSERT INTO "Treatments" VALUES ("301", "1", "202");
INSERT INTO "Treatments" VALUES ("302", "2", "202");
INSERT INTO "Treatments" VALUES ("303", "3", "202");
INSERT INTO "Treatments" VALUES ("304", "4", "204");
INSERT INTO "Treatments" VALUES ("305", "5", "204");
INSERT INTO "Treatments" VALUES ("306", "6", "205");
INSERT INTO "Treatments" VALUES ("307", "7", "206");
INSERT INTO "Treatments" VALUES ("308", "8", "207");
INSERT INTO "Treatments" VALUES ("309", "1", "207");
INSERT INTO "Treatments" VALUES ("310", "2", "207");