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 "Addresses" (
"address_id" INT UNIQUE,
"city" VARCHAR(255),
PRIMARY KEY ("address_id")
);

CREATE TABLE "Students" (
"student_id" INT,
"current_address_id" INT,
"permanent_address_id" INT,
"first_name" VARCHAR(80),
"last_name" VARCHAR(40),
"email_address" VARCHAR(40),
PRIMARY KEY ("student_id"),
FOREIGN KEY ("permanent_address_id") REFERENCES "Addresses"("address_id"),
FOREIGN KEY ("current_address_id") REFERENCES "Addresses"("address_id")
);





INSERT INTO "Addresses" VALUES ("1", "New York");
INSERT INTO "Addresses" VALUES ("2", "Los Angeles");
INSERT INTO "Addresses" VALUES ("3", "Chicago");
INSERT INTO "Addresses" VALUES ("4", "Houston");
INSERT INTO "Addresses" VALUES ("5", "Phoenix");
INSERT INTO "Addresses" VALUES ("6", "Philadelphia");
INSERT INTO "Addresses" VALUES ("7", "San Antonio");
INSERT INTO "Addresses" VALUES ("8", "San Diego");
INSERT INTO "Addresses" VALUES ("9", "Dallas");
INSERT INTO "Addresses" VALUES ("10", "San Jose");
INSERT INTO "Students" VALUES ("1", "1", "1", "Alice", "Smith", "alice.s@example.com");
INSERT INTO "Students" VALUES ("2", "2", "3", "Bob", "Johnson", "bob.j@example.com");
INSERT INTO "Students" VALUES ("3", "4", "4", "Charlie", "Brown", "charlie.b@example.com");
INSERT INTO "Students" VALUES ("4", "5", "2", "Diana", "Prince", "diana.p@example.com");
INSERT INTO "Students" VALUES ("5", "6", "6", "Eve", "Adams", "eve.a@example.com");
INSERT INTO "Students" VALUES ("6", "7", "8", "Frank", "White", "frank.w@example.com");
INSERT INTO "Students" VALUES ("7", "9", "9", "Grace", "Green", "grace.g@example.com");
INSERT INTO "Students" VALUES ("8", "10", "5", "Henry", "Black", "henry.b@example.com");
INSERT INTO "Students" VALUES ("9", "1", "7", "Ivy", "Blue", "ivy.b@example.com");
INSERT INTO "Students" VALUES ("10", "3", "10", "Jack", "Red", "jack.r@example.com");