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

CREATE TABLE "Owners" (
"owner_id" INT UNIQUE,
PRIMARY KEY ("owner_id")
);

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

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





INSERT INTO "Dogs" VALUES ("1", "2023-01-01 10:00:00", "2023-01-15 14:00:00", "2023-01-15 14:00:00");
INSERT INTO "Dogs" VALUES ("2", "2023-01-05 09:00:00", "NULL", "2023-01-20 16:00:00");
INSERT INTO "Dogs" VALUES ("3", "2023-01-10 11:00:00", "2023-02-01 10:00:00", "2023-02-01 10:00:00");
INSERT INTO "Dogs" VALUES ("4", "2023-01-12 13:00:00", "NULL", "NULL");
INSERT INTO "Dogs" VALUES ("5", "2023-01-15 08:00:00", "2023-01-25 17:00:00", "2023-01-25 17:00:00");
INSERT INTO "Dogs" VALUES ("6", "2023-01-20 10:00:00", "NULL", "NULL");
INSERT INTO "Dogs" VALUES ("7", "2023-01-22 14:00:00", "2023-02-10 11:00:00", "2023-02-10 11:00:00");
INSERT INTO "Dogs" VALUES ("8", "2023-01-25 09:00:00", "NULL", "2023-02-15 15:00:00");
INSERT INTO "Dogs" VALUES ("9", "2023-01-28 11:00:00", "NULL", "NULL");
INSERT INTO "Dogs" VALUES ("10", "2023-02-01 12:00:00", "2023-02-20 13:00:00", "2023-02-20 13:00:00");
INSERT INTO "Owners" VALUES ("101");
INSERT INTO "Owners" VALUES ("102");
INSERT INTO "Owners" VALUES ("103");
INSERT INTO "Owners" VALUES ("104");
INSERT INTO "Owners" VALUES ("105");
INSERT INTO "Professionals" VALUES ("201");
INSERT INTO "Professionals" VALUES ("202");
INSERT INTO "Professionals" VALUES ("203");
INSERT INTO "Professionals" VALUES ("204");
INSERT INTO "Treatments" VALUES ("1001", "1");
INSERT INTO "Treatments" VALUES ("1002", "2");
INSERT INTO "Treatments" VALUES ("1003", "3");
INSERT INTO "Treatments" VALUES ("1004", "5");
INSERT INTO "Treatments" VALUES ("1005", "7");
INSERT INTO "Treatments" VALUES ("1006", "8");
INSERT INTO "Treatments" VALUES ("1007", "10");
INSERT INTO "Treatments" VALUES ("1008", "1");
INSERT INTO "Treatments" VALUES ("1009", "3");
INSERT INTO "Treatments" VALUES ("1010", "5");