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

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

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", "Buddy", "5 years", "2018-01-15 00:00:00");
INSERT INTO "Dogs" VALUES ("2", "Lucy", "2 years", "2021-03-20 00:00:00");
INSERT INTO "Dogs" VALUES ("3", "Max", "8 years", "2015-07-01 00:00:00");
INSERT INTO "Dogs" VALUES ("4", "Daisy", "1 year", "2022-11-10 00:00:00");
INSERT INTO "Dogs" VALUES ("5", "Charlie", "4 years", "2019-05-25 00:00:00");
INSERT INTO "Dogs" VALUES ("6", "Bella", "7 years", "2016-09-05 00:00:00");
INSERT INTO "Dogs" VALUES ("7", "Rocky", "3 years", "2020-02-14 00:00:00");
INSERT INTO "Dogs" VALUES ("8", "Luna", "6 years", "2017-04-30 00:00:00");
INSERT INTO "Dogs" VALUES ("9", "Milo", "9 years", "2014-12-01 00:00:00");
INSERT INTO "Dogs" VALUES ("10", "Sophie", "10 years", "2013-06-18 00:00:00");
INSERT INTO "Treatment_Types" VALUES ("VACC", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("DEWORM", "Deworming");
INSERT INTO "Treatment_Types" VALUES ("GROOM", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("CHECKUP", "Annual Checkup");
INSERT INTO "Treatment_Types" VALUES ("SURG", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("DENTAL", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("101", "1");
INSERT INTO "Treatments" VALUES ("102", "1");
INSERT INTO "Treatments" VALUES ("103", "3");
INSERT INTO "Treatments" VALUES ("104", "5");
INSERT INTO "Treatments" VALUES ("105", "6");
INSERT INTO "Treatments" VALUES ("106", "8");
INSERT INTO "Treatments" VALUES ("107", "9");
INSERT INTO "Treatments" VALUES ("108", "10");
INSERT INTO "Treatments" VALUES ("109", "1");
INSERT INTO "Treatments" VALUES ("110", "3");
INSERT INTO "Treatments" VALUES ("111", "5");
INSERT INTO "Treatments" VALUES ("112", "6");
INSERT INTO "Treatments" VALUES ("113", "8");
INSERT INTO "Treatments" VALUES ("114", "9");
INSERT INTO "Treatments" VALUES ("115", "10");