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 UNIQUE,
PRIMARY KEY ("dog_id")
);

CREATE TABLE "Professionals" (
"professional_id" INT UNIQUE,
"role_code" VARCHAR(10),
"first_name" VARCHAR(50),
PRIMARY KEY ("professional_id")
);

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

CREATE TABLE "Treatments" (
"treatment_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 "Dogs" VALUES ("1");
INSERT INTO "Dogs" VALUES ("2");
INSERT INTO "Dogs" VALUES ("3");
INSERT INTO "Dogs" VALUES ("4");
INSERT INTO "Dogs" VALUES ("5");
INSERT INTO "Professionals" VALUES ("101", "VET", "Alice");
INSERT INTO "Professionals" VALUES ("102", "TECH", "Bob");
INSERT INTO "Professionals" VALUES ("103", "VET", "Charlie");
INSERT INTO "Professionals" VALUES ("104", "GROOM", "Diana");
INSERT INTO "Professionals" VALUES ("105", "TECH", "Eve");
INSERT INTO "Treatment_Types" VALUES ("VAC", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("CHK", "General Checkup");
INSERT INTO "Treatment_Types" VALUES ("DNT", "Dental Cleaning");
INSERT INTO "Treatment_Types" VALUES ("GRM", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("SUR", "Surgery");
INSERT INTO "Treatments" VALUES ("201", "101", "VAC", "2024-01-15 09:00:00");
INSERT INTO "Treatments" VALUES ("202", "102", "CHK", "2024-01-16 10:30:00");
INSERT INTO "Treatments" VALUES ("203", "103", "SUR", "2024-01-17 14:00:00");
INSERT INTO "Treatments" VALUES ("204", "104", "GRM", "2024-01-18 11:00:00");
INSERT INTO "Treatments" VALUES ("205", "105", "DNT", "2024-01-19 15:30:00");
INSERT INTO "Treatments" VALUES ("206", "101", "CHK", "2024-02-01 09:30:00");
INSERT INTO "Treatments" VALUES ("207", "102", "VAC", "2024-02-02 10:00:00");
INSERT INTO "Treatments" VALUES ("208", "104", "GRM", "2024-02-03 13:00:00");
INSERT INTO "Treatments" VALUES ("209", "105", "DNT", "2024-02-04 14:30:00");
INSERT INTO "Treatments" VALUES ("210", "103", "SUR", "2024-02-05 16:00:00");