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,
"home_phone" VARCHAR(20),
"cell_number" VARCHAR(20),
PRIMARY KEY ("professional_id")
);

CREATE TABLE "Treatment_Types" (
"treatment_type_code" VARCHAR(10) UNIQUE,
PRIMARY KEY ("treatment_type_code")
);

CREATE TABLE "Treatments" (
"treatment_id" INT,
"dog_id" INT,
"professional_id" INT,
"treatment_type_code" VARCHAR(10),
"date_of_treatment" DATETIME,
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 ("101", "555-123-4567", "555-987-6543");
INSERT INTO "Professionals" VALUES ("102", "555-234-5678", "555-876-5432");
INSERT INTO "Professionals" VALUES ("103", "555-345-6789", "555-765-4321");
INSERT INTO "Professionals" VALUES ("104", "555-456-7890", "555-654-3210");
INSERT INTO "Professionals" VALUES ("105", "555-567-8901", "555-543-2109");
INSERT INTO "Treatment_Types" VALUES ("VET");
INSERT INTO "Treatment_Types" VALUES ("GROOM");
INSERT INTO "Treatment_Types" VALUES ("TRAIN");
INSERT INTO "Treatment_Types" VALUES ("WALK");
INSERT INTO "Treatment_Types" VALUES ("BOARD");
INSERT INTO "Treatments" VALUES ("1", "1", "101", "VET", "2023-01-15 10:00:00");
INSERT INTO "Treatments" VALUES ("2", "1", "101", "GROOM", "2023-01-16 14:30:00");
INSERT INTO "Treatments" VALUES ("3", "2", "101", "VET", "2023-01-17 09:00:00");
INSERT INTO "Treatments" VALUES ("4", "3", "102", "TRAIN", "2023-01-18 11:00:00");
INSERT INTO "Treatments" VALUES ("5", "3", "102", "WALK", "2023-01-19 16:00:00");
INSERT INTO "Treatments" VALUES ("6", "4", "103", "GROOM", "2023-01-20 10:00:00");
INSERT INTO "Treatments" VALUES ("7", "5", "104", "VET", "2023-01-21 13:00:00");
INSERT INTO "Treatments" VALUES ("8", "6", "104", "VET", "2023-01-22 10:00:00");
INSERT INTO "Treatments" VALUES ("9", "7", "105", "BOARD", "2023-01-23 08:00:00");
INSERT INTO "Treatments" VALUES ("10", "8", "105", "BOARD", "2023-01-24 09:00:00");
INSERT INTO "Treatments" VALUES ("11", "9", "101", "TRAIN", "2023-01-25 15:00:00");
INSERT INTO "Treatments" VALUES ("12", "10", "102", "VET", "2023-01-26 10:00:00");
INSERT INTO "Treatments" VALUES ("13", "11", "103", "TRAIN", "2023-01-27 11:00:00");
INSERT INTO "Treatments" VALUES ("14", "12", "103", "WALK", "2023-01-28 14:00:00");
INSERT INTO "Treatments" VALUES ("15", "13", "104", "GROOM", "2023-01-29 10:00:00");
INSERT INTO "Treatments" VALUES ("16", "14", "104", "TRAIN", "2023-01-30 16:00:00");
INSERT INTO "Treatments" VALUES ("17", "15", "105", "VET", "2023-01-31 09:00:00");
INSERT INTO "Treatments" VALUES ("18", "16", "105", "GROOM", "2023-02-01 13:00:00");