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,
"age" VARCHAR(20),
"date_of_birth" DATETIME,
"date_arrived" DATETIME,
PRIMARY KEY ("dog_id")
);

CREATE TABLE "Owners" (
"owner_id" INT,
"first_name" VARCHAR(50),
PRIMARY KEY ("owner_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", "2 years", "2021-01-15", "2023-01-01");
INSERT INTO "Dogs" VALUES ("2", "5 years", "2018-03-10", "2023-02-15");
INSERT INTO "Dogs" VALUES ("3", "1 year", "2022-06-20", "2023-03-01");
INSERT INTO "Dogs" VALUES ("4", "3 years", "2020-09-01", "2023-04-10");
INSERT INTO "Dogs" VALUES ("5", "7 years", "2016-11-25", "2023-05-05");
INSERT INTO "Dogs" VALUES ("6", "4 years", "2019-07-12", "2023-06-20");
INSERT INTO "Dogs" VALUES ("7", "6 months", "2023-01-01", "2023-07-01");
INSERT INTO "Dogs" VALUES ("8", "10 years", "2013-02-28", "2023-08-15");
INSERT INTO "Dogs" VALUES ("9", "9 years", "2014-04-05", "2023-09-01");
INSERT INTO "Dogs" VALUES ("10", "8 years", "2015-08-18", "2023-10-10");
INSERT INTO "Owners" VALUES ("1", "Alice");
INSERT INTO "Owners" VALUES ("2", "Bob");
INSERT INTO "Owners" VALUES ("3", "Charlie");
INSERT INTO "Owners" VALUES ("4", "David");
INSERT INTO "Owners" VALUES ("5", "Eve");
INSERT INTO "Owners" VALUES ("6", "Frank");
INSERT INTO "Owners" VALUES ("7", "Grace");
INSERT INTO "Owners" VALUES ("8", "Heidi");
INSERT INTO "Owners" VALUES ("9", "Ivan");
INSERT INTO "Owners" VALUES ("10", "Judy");
INSERT INTO "Treatments" VALUES ("1", "1");
INSERT INTO "Treatments" VALUES ("2", "2");
INSERT INTO "Treatments" VALUES ("3", "3");
INSERT INTO "Treatments" VALUES ("4", "1");
INSERT INTO "Treatments" VALUES ("5", "4");
INSERT INTO "Treatments" VALUES ("6", "5");
INSERT INTO "Treatments" VALUES ("7", "2");
INSERT INTO "Treatments" VALUES ("8", "6");
INSERT INTO "Treatments" VALUES ("9", "7");
INSERT INTO "Treatments" VALUES ("10", "8");
INSERT INTO "Treatments" VALUES ("11", "9");
INSERT INTO "Treatments" VALUES ("12", "10");
INSERT INTO "Treatments" VALUES ("13", "3");
INSERT INTO "Treatments" VALUES ("14", "5");
INSERT INTO "Treatments" VALUES ("15", "6");