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 "Has_Pet" (
"StuID" INT,
"PetID" INT,
FOREIGN KEY ("PetID") REFERENCES "Pets"("PetID"),
FOREIGN KEY ("StuID") REFERENCES "Student"("StuID")
);

CREATE TABLE "Pets" (
"PetID" INT UNIQUE,
"PetType" VARCHAR(20),
"pet_age" INT,
PRIMARY KEY ("PetID")
);

CREATE TABLE "Student" (
"StuID" INT UNIQUE,
"LName" VARCHAR(12),
"Fname" VARCHAR(12),
PRIMARY KEY ("StuID")
);





INSERT INTO "Student" VALUES ("1", "Smith", "Alice");
INSERT INTO "Student" VALUES ("2", "Jones", "Bob");
INSERT INTO "Student" VALUES ("3", "Williams", "Charlie");
INSERT INTO "Student" VALUES ("4", "Brown", "Diana");
INSERT INTO "Student" VALUES ("5", "Davis", "Eve");
INSERT INTO "Student" VALUES ("6", "Miller", "Frank");
INSERT INTO "Student" VALUES ("7", "Wilson", "Grace");
INSERT INTO "Student" VALUES ("8", "Moore", "Henry");
INSERT INTO "Student" VALUES ("9", "Taylor", "Ivy");
INSERT INTO "Student" VALUES ("10", "Anderson", "Jack");
INSERT INTO "Pets" VALUES ("101", "Dog", "5");
INSERT INTO "Pets" VALUES ("102", "cat", "3");
INSERT INTO "Pets" VALUES ("103", "Bird", "2");
INSERT INTO "Pets" VALUES ("104", "Fish", "1");
INSERT INTO "Pets" VALUES ("105", "cat", "7");
INSERT INTO "Pets" VALUES ("106", "Dog", "4");
INSERT INTO "Pets" VALUES ("107", "Rabbit", "2");
INSERT INTO "Pets" VALUES ("108", "cat", "1");
INSERT INTO "Pets" VALUES ("109", "Hamster", "1");
INSERT INTO "Pets" VALUES ("110", "Dog", "6");
INSERT INTO "Has_Pet" VALUES ("1", "101");
INSERT INTO "Has_Pet" VALUES ("2", "102");
INSERT INTO "Has_Pet" VALUES ("3", "103");
INSERT INTO "Has_Pet" VALUES ("4", "104");
INSERT INTO "Has_Pet" VALUES ("5", "105");
INSERT INTO "Has_Pet" VALUES ("1", "106");
INSERT INTO "Has_Pet" VALUES ("6", "107");
INSERT INTO "Has_Pet" VALUES ("7", "108");
INSERT INTO "Has_Pet" VALUES ("8", "109");
INSERT INTO "Has_Pet" VALUES ("9", "110");
INSERT INTO "Has_Pet" VALUES ("10", "101");
INSERT INTO "Has_Pet" VALUES ("1", "103");
INSERT INTO "Has_Pet" VALUES ("6", "102");
INSERT INTO "Has_Pet" VALUES ("8", "105");