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,
"breed_code" VARCHAR(10),
"age" VARCHAR(20),
"gender" VARCHAR(1),
PRIMARY KEY ("dog_id"),
FOREIGN KEY ("breed_code") REFERENCES "Breeds"("breed_code")
);

CREATE TABLE "Sizes" (
"size_code" VARCHAR(10),
"size_description" VARCHAR(80),
PRIMARY KEY ("size_code")
);





INSERT INTO "Breeds" VALUES ("BD001", "Labrador Retriever");
INSERT INTO "Breeds" VALUES ("BD002", "German Shepherd");
INSERT INTO "Breeds" VALUES ("BD003", "Beagle");
INSERT INTO "Breeds" VALUES ("BD004", "Bulldog");
INSERT INTO "Breeds" VALUES ("BD005", "Poodle");
INSERT INTO "Breeds" VALUES ("BD006", "Rottweiler");
INSERT INTO "Breeds" VALUES ("BD007", "Yorkshire Terrier");
INSERT INTO "Dogs" VALUES ("1", "BD001", "3 years", "M");
INSERT INTO "Dogs" VALUES ("2", "BD001", "5 years", "F");
INSERT INTO "Dogs" VALUES ("3", "BD001", "1 year", "M");
INSERT INTO "Dogs" VALUES ("4", "BD002", "4 years", "F");
INSERT INTO "Dogs" VALUES ("5", "BD002", "2 years", "M");
INSERT INTO "Dogs" VALUES ("6", "BD003", "6 years", "F");
INSERT INTO "Dogs" VALUES ("7", "BD003", "3 years", "M");
INSERT INTO "Dogs" VALUES ("8", "BD003", "2 years", "F");
INSERT INTO "Dogs" VALUES ("9", "BD003", "1 year", "M");
INSERT INTO "Dogs" VALUES ("10", "BD004", "7 years", "F");
INSERT INTO "Dogs" VALUES ("11", "BD005", "4 years", "M");
INSERT INTO "Dogs" VALUES ("12", "BD005", "5 years", "F");
INSERT INTO "Dogs" VALUES ("13", "BD006", "3 years", "M");
INSERT INTO "Dogs" VALUES ("14", "BD007", "2 years", "F");
INSERT INTO "Dogs" VALUES ("15", "BD001", "6 years", "F");
INSERT INTO "Dogs" VALUES ("16", "BD001", "4 years", "M");
INSERT INTO "Dogs" VALUES ("17", "BD001", "2 years", "F");
INSERT INTO "Dogs" VALUES ("18", "BD001", "1 year", "M");
INSERT INTO "Sizes" VALUES ("SZ001", "Small");
INSERT INTO "Sizes" VALUES ("SZ002", "Medium");
INSERT INTO "Sizes" VALUES ("SZ003", "Large");
INSERT INTO "Sizes" VALUES ("SZ004", "Extra Large");