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 "Breeds" (
"breed_code" VARCHAR(10) UNIQUE,
"breed_name" VARCHAR(80),
PRIMARY KEY ("breed_code")
);

CREATE TABLE "Dogs" (
"dog_id" INT UNIQUE,
"breed_code" VARCHAR(10),
"name" VARCHAR(50),
"age" VARCHAR(20),
PRIMARY KEY ("dog_id"),
FOREIGN KEY ("breed_code") REFERENCES "Breeds"("breed_code")
);

CREATE TABLE "Owners" (
"owner_id" INT,
"first_name" VARCHAR(50),
PRIMARY KEY ("owner_id")
);

CREATE TABLE "Professionals" (
"professional_id" INT,
"first_name" VARCHAR(50),
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 "Breeds" VALUES ("LAB", "Labrador Retriever");
INSERT INTO "Breeds" VALUES ("GSD", "German Shepherd");
INSERT INTO "Breeds" VALUES ("PUD", "Poodle");
INSERT INTO "Breeds" VALUES ("BEA", "Beagle");
INSERT INTO "Breeds" VALUES ("BUL", "Bulldog");
INSERT INTO "Breeds" VALUES ("CHI", "Chihuahua");
INSERT INTO "Breeds" VALUES ("DACH", "Dachshund");
INSERT INTO "Breeds" VALUES ("BOX", "Boxer");
INSERT INTO "Breeds" VALUES ("SIBH", "Siberian Husky");
INSERT INTO "Breeds" VALUES ("AUS", "Australian Shepherd");
INSERT INTO "Breeds" VALUES ("GREY", "Greyhound");
INSERT INTO "Breeds" VALUES ("BAS", "Basset Hound");
INSERT INTO "Breeds" VALUES ("SHI", "Shih Tzu");
INSERT INTO "Breeds" VALUES ("COR", "Corgi");
INSERT INTO "Breeds" VALUES ("BER", "Bernese Mountain Dog");
INSERT INTO "Breeds" VALUES ("ROTT", "Rottweiler");
INSERT INTO "Breeds" VALUES ("DOB", "Doberman Pinscher");
INSERT INTO "Breeds" VALUES ("MINP", "Miniature Pinscher");
INSERT INTO "Breeds" VALUES ("POM", "Pomeranian");
INSERT INTO "Breeds" VALUES ("BICH", "Bichon Frise");
INSERT INTO "Dogs" VALUES ("1", "LAB", "Buddy", "5 years");
INSERT INTO "Dogs" VALUES ("2", "GSD", "Max", "3 years");
INSERT INTO "Dogs" VALUES ("3", "PUD", "Bella", "2 years");
INSERT INTO "Dogs" VALUES ("4", "LAB", "Lucy", "7 years");
INSERT INTO "Dogs" VALUES ("5", "BEA", "Charlie", "1 year");
INSERT INTO "Dogs" VALUES ("6", "BUL", "Daisy", "4 years");
INSERT INTO "Dogs" VALUES ("7", "CHI", "Rocky", "6 years");
INSERT INTO "Dogs" VALUES ("8", "DACH", "Molly", "2 years");
INSERT INTO "Dogs" VALUES ("9", "BOX", "Duke", "3 years");
INSERT INTO "Dogs" VALUES ("10", "SIBH", "Luna", "1 year");
INSERT INTO "Dogs" VALUES ("11", "AUS", "Cooper", "5 years");
INSERT INTO "Dogs" VALUES ("12", "GREY", "Sophie", "8 years");
INSERT INTO "Dogs" VALUES ("13", "BAS", "Bailey", "4 years");
INSERT INTO "Dogs" VALUES ("14", "SHI", "Chloe", "2 years");
INSERT INTO "Dogs" VALUES ("15", "COR", "Winston", "3 years");
INSERT INTO "Dogs" VALUES ("16", "BER", "Bear", "6 years");
INSERT INTO "Dogs" VALUES ("17", "ROTT", "Zeus", "5 years");
INSERT INTO "Dogs" VALUES ("18", "DOB", "Apollo", "4 years");
INSERT INTO "Dogs" VALUES ("19", "MINP", "Gizmo", "7 years");
INSERT INTO "Dogs" VALUES ("20", "POM", "Princess", "3 years");
INSERT INTO "Dogs" VALUES ("21", "BICH", "Snowball", "2 years");
INSERT INTO "Dogs" VALUES ("22", "GREY", "Flash", "9 years");
INSERT INTO "Dogs" VALUES ("23", "GREY", "Speedy", "1 year");
INSERT INTO "Dogs" VALUES ("24", "BICH", "Cotton", "3 years");
INSERT INTO "Dogs" VALUES ("25", "BICH", "Fluffy", "1 year");
INSERT INTO "Dogs" VALUES ("26", "BICH", "Puff", "4 years");
INSERT INTO "Dogs" VALUES ("27", "GREY", "Bolt", "2 years");
INSERT INTO "Dogs" VALUES ("28", "GREY", "Dash", "6 years");
INSERT INTO "Dogs" VALUES ("29", "GREY", "Zoom", "3 years");
INSERT INTO "Dogs" VALUES ("30", "BICH", "Cloud", "5 years");
INSERT INTO "Owners" VALUES ("1", "Alice");
INSERT INTO "Owners" VALUES ("2", "Bob");
INSERT INTO "Owners" VALUES ("3", "Charlie");
INSERT INTO "Owners" VALUES ("4", "Diana");
INSERT INTO "Owners" VALUES ("5", "Eve");
INSERT INTO "Professionals" VALUES ("1", "Dr. Smith");
INSERT INTO "Professionals" VALUES ("2", "Dr. Jones");
INSERT INTO "Professionals" VALUES ("3", "Dr. Williams");
INSERT INTO "Treatments" VALUES ("1", "1", "2023-01-15 10:00:00");
INSERT INTO "Treatments" VALUES ("2", "2", "2023-02-20 11:30:00");
INSERT INTO "Treatments" VALUES ("3", "3", "2023-03-10 09:00:00");
INSERT INTO "Treatments" VALUES ("4", "12", "2023-04-05 14:00:00");
INSERT INTO "Treatments" VALUES ("5", "13", "2023-05-12 10:45:00");
INSERT INTO "Treatments" VALUES ("6", "14", "2023-06-18 13:15:00");
INSERT INTO "Treatments" VALUES ("7", "15", "2023-07-22 16:00:00");
INSERT INTO "Treatments" VALUES ("8", "16", "2023-08-01 09:30:00");
INSERT INTO "Treatments" VALUES ("9", "17", "2023-09-09 11:00:00");
INSERT INTO "Treatments" VALUES ("10", "18", "2023-10-14 15:00:00");
INSERT INTO "Treatments" VALUES ("11", "19", "2023-11-25 12:00:00");
INSERT INTO "Treatments" VALUES ("12", "20", "2023-12-30 10:00:00");
INSERT INTO "Treatments" VALUES ("13", "21", "2024-01-05 09:00:00");
INSERT INTO "Treatments" VALUES ("14", "22", "2024-02-10 11:00:00");
INSERT INTO "Treatments" VALUES ("15", "23", "2024-03-15 14:00:00");
INSERT INTO "Treatments" VALUES ("16", "24", "2024-04-20 10:30:00");
INSERT INTO "Treatments" VALUES ("17", "25", "2024-05-25 13:00:00");
INSERT INTO "Treatments" VALUES ("18", "26", "2024-06-30 16:00:00");
INSERT INTO "Treatments" VALUES ("19", "27", "2024-07-01 09:00:00");
INSERT INTO "Treatments" VALUES ("20", "28", "2024-08-05 11:00:00");
INSERT INTO "Treatments" VALUES ("21", "29", "2024-09-10 14:00:00");
INSERT INTO "Treatments" VALUES ("22", "30", "2024-10-15 10:30:00");
INSERT INTO "Treatments" VALUES ("23", "12", "2024-01-01 08:00:00");
INSERT INTO "Treatments" VALUES ("24", "22", "2024-02-02 09:00:00");
INSERT INTO "Treatments" VALUES ("25", "27", "2024-03-03 10:00:00");
INSERT INTO "Treatments" VALUES ("26", "24", "2024-04-04 11:00:00");
INSERT INTO "Treatments" VALUES ("27", "25", "2024-05-05 12:00:00");
INSERT INTO "Treatments" VALUES ("28", "26", "2024-06-06 13:00:00");
INSERT INTO "Treatments" VALUES ("29", "30", "2024-07-07 14:00:00");