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,
"breed_code" VARCHAR(10),
"date_arrived" DATETIME,
"date_departed" DATETIME,
PRIMARY KEY ("dog_id")
);

CREATE TABLE "Professionals" (
"professional_id" INT UNIQUE,
PRIMARY KEY ("professional_id")
);

CREATE TABLE "Treatments" (
"treatment_id" INT,
"dog_id" INT,
"date_of_treatment" DATETIME,
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("dog_id") REFERENCES "Dogs"("dog_id")
);





INSERT INTO "Dogs" VALUES ("1", "BC001", "2023-01-10", "2023-01-20");
INSERT INTO "Dogs" VALUES ("2", "BC002", "2023-02-15", "2023-02-25");
INSERT INTO "Dogs" VALUES ("3", "BC003", "2023-03-01", "NULL");
INSERT INTO "Dogs" VALUES ("4", "BC004", "2023-01-05", "2023-01-15");
INSERT INTO "Dogs" VALUES ("5", "BC005", "2023-04-10", "2023-04-20");
INSERT INTO "Dogs" VALUES ("6", "BC006", "2023-05-01", "NULL");
INSERT INTO "Dogs" VALUES ("7", "BC007", "2023-06-01", "2023-06-10");
INSERT INTO "Dogs" VALUES ("8", "BC008", "2023-07-01", "2023-07-15");
INSERT INTO "Dogs" VALUES ("9", "BC009", "2023-08-01", "NULL");
INSERT INTO "Dogs" VALUES ("10", "BC010", "2023-09-01", "2023-09-10");
INSERT INTO "Professionals" VALUES ("101");
INSERT INTO "Professionals" VALUES ("102");
INSERT INTO "Professionals" VALUES ("103");
INSERT INTO "Professionals" VALUES ("104");
INSERT INTO "Professionals" VALUES ("105");
INSERT INTO "Treatments" VALUES ("1001", "1", "2023-01-12");
INSERT INTO "Treatments" VALUES ("1002", "2", "2023-02-20");
INSERT INTO "Treatments" VALUES ("1003", "3", "2023-03-05");
INSERT INTO "Treatments" VALUES ("1004", "4", "2023-01-10");
INSERT INTO "Treatments" VALUES ("1005", "5", "2023-04-15");
INSERT INTO "Treatments" VALUES ("1006", "7", "2023-06-05");
INSERT INTO "Treatments" VALUES ("1007", "8", "2023-07-10");
INSERT INTO "Treatments" VALUES ("1008", "10", "2023-09-05");