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,
"owner_id" INT,
"date_adopted" DATETIME,
"date_departed" DATETIME,
PRIMARY KEY ("dog_id"),
FOREIGN KEY ("owner_id") REFERENCES "Owners"("owner_id")
);

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





INSERT INTO "Owners" VALUES ("1", "owner1@example.com");
INSERT INTO "Owners" VALUES ("2", "owner2@example.com");
INSERT INTO "Owners" VALUES ("3", "owner3@example.com");
INSERT INTO "Owners" VALUES ("4", "owner4@example.com");
INSERT INTO "Owners" VALUES ("5", "owner5@example.com");
INSERT INTO "Owners" VALUES ("6", "owner6@example.com");
INSERT INTO "Owners" VALUES ("7", "owner7@example.com");
INSERT INTO "Owners" VALUES ("8", "owner8@example.com");
INSERT INTO "Owners" VALUES ("9", "owner9@example.com");
INSERT INTO "Owners" VALUES ("10", "owner10@example.com");
INSERT INTO "Dogs" VALUES ("101", "1", "2023-01-10", "2023-06-01");
INSERT INTO "Dogs" VALUES ("102", "1", "2023-07-01", "NULL");
INSERT INTO "Dogs" VALUES ("103", "2", "2022-05-15", "2023-05-15");
INSERT INTO "Dogs" VALUES ("104", "3", "2023-03-20", "NULL");
INSERT INTO "Dogs" VALUES ("105", "4", "2023-04-01", "2023-04-15");
INSERT INTO "Dogs" VALUES ("106", "5", "2023-02-10", "2023-02-20");
INSERT INTO "Dogs" VALUES ("107", "6", "2023-05-01", "NULL");
INSERT INTO "Dogs" VALUES ("108", "6", "2023-06-01", "2023-06-30");
INSERT INTO "Dogs" VALUES ("109", "7", "2023-01-01", "2023-01-10");
INSERT INTO "Dogs" VALUES ("110", "8", "2023-07-01", "NULL");
INSERT INTO "Dogs" VALUES ("111", "8", "2023-07-15", "NULL");
INSERT INTO "Dogs" VALUES ("112", "9", "2023-01-01", "2023-01-01");