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 ("1", "555-123-4567", "555-987-6543");
INSERT INTO "Professionals" VALUES ("2", "555-234-5678", "555-876-5432");
INSERT INTO "Professionals" VALUES ("3", "555-345-6789", "555-765-4321");
INSERT INTO "Professionals" VALUES ("4", "555-456-7890", "555-654-3210");
INSERT INTO "Professionals" VALUES ("5", "555-567-8901", "555-543-2109");
INSERT INTO "Treatment_Types" VALUES ("VACC");
INSERT INTO "Treatment_Types" VALUES ("GROOM");
INSERT INTO "Treatment_Types" VALUES ("TRAIN");
INSERT INTO "Treatment_Types" VALUES ("CHECKUP");
INSERT INTO "Treatment_Types" VALUES ("SURGERY");
INSERT INTO "Treatments" VALUES ("1", "101", "1", "VACC", "2023-01-15 10:00:00");
INSERT INTO "Treatments" VALUES ("2", "102", "1", "GROOM", "2023-01-16 11:00:00");
INSERT INTO "Treatments" VALUES ("3", "103", "1", "TRAIN", "2023-01-17 12:00:00");
INSERT INTO "Treatments" VALUES ("4", "104", "2", "VACC", "2023-01-18 13:00:00");
INSERT INTO "Treatments" VALUES ("5", "105", "2", "GROOM", "2023-01-19 14:00:00");
INSERT INTO "Treatments" VALUES ("6", "106", "3", "TRAIN", "2023-01-20 15:00:00");
INSERT INTO "Treatments" VALUES ("7", "107", "3", "CHECKUP", "2023-01-21 16:00:00");
INSERT INTO "Treatments" VALUES ("8", "108", "4", "VACC", "2023-01-22 17:00:00");
INSERT INTO "Treatments" VALUES ("9", "109", "5", "SURGERY", "2023-01-23 09:00:00");
INSERT INTO "Treatments" VALUES ("10", "110", "5", "CHECKUP", "2023-01-24 10:00:00");
INSERT INTO "Treatments" VALUES ("11", "111", "5", "VACC", "2023-01-25 11:00:00");
INSERT INTO "Treatments" VALUES ("12", "112", "4", "GROOM", "2023-01-26 12:00:00");
INSERT INTO "Treatments" VALUES ("13", "113", "4", "TRAIN", "2023-01-27 13:00:00");
INSERT INTO "Treatments" VALUES ("14", "114", "2", "TRAIN", "2023-01-28 14:00:00");
INSERT INTO "Treatments" VALUES ("15", "115", "1", "CHECKUP", "2023-01-29 15:00:00");