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

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

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





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