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,
"line_1" VARCHAR(255),
"line_2" VARCHAR(255),
"line_3" VARCHAR(255),
"city" VARCHAR(255),
"zip_postcode" VARCHAR(20),
"state_province_county" VARCHAR(255),
"country" VARCHAR(255),
PRIMARY KEY ("address_id")
);

CREATE TABLE "Degree_Programs" (
"degree_program_id" INT,
"department_id" INT,
PRIMARY KEY ("degree_program_id")
);

CREATE TABLE "Students" (
"student_id" INT,
"current_address_id" INT,
"permanent_address_id" INT,
"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", "123 Maple St", "Apt 4B", "", "Springfield", "01101", "MA", "USA");
INSERT INTO "Addresses" VALUES ("2", "456 Oak Ave", "", "", "Springfield", "01102", "MA", "USA");
INSERT INTO "Addresses" VALUES ("3", "789 Pine Rd", "Suite 12", "Building C", "Shelbyville", "02101", "MA", "USA");
INSERT INTO "Addresses" VALUES ("4", "321 Birch Blvd", "", "", "Capital City", "03101", "MA", "USA");
INSERT INTO "Addresses" VALUES ("5", "654 Cedar Ln", "Floor 3", "", "Ogdenville", "04101", "MA", "USA");
INSERT INTO "Addresses" VALUES ("6", "987 Elm St", "", "", "North Haverbrook", "05101", "MA", "USA");
INSERT INTO "Degree_Programs" VALUES ("1", "10");
INSERT INTO "Degree_Programs" VALUES ("2", "20");
INSERT INTO "Degree_Programs" VALUES ("3", "30");
INSERT INTO "Students" VALUES ("101", "1", "3", "alice@example.com");
INSERT INTO "Students" VALUES ("102", "1", "4", "bob@example.com");
INSERT INTO "Students" VALUES ("103", "1", "5", "carol@example.com");
INSERT INTO "Students" VALUES ("104", "2", "1", "dave@example.com");
INSERT INTO "Students" VALUES ("105", "2", "6", "eve@example.com");
INSERT INTO "Students" VALUES ("106", "3", "2", "frank@example.com");
INSERT INTO "Students" VALUES ("107", "4", "3", "grace@example.com");
INSERT INTO "Students" VALUES ("108", "5", "4", "heidi@example.com");
INSERT INTO "Students" VALUES ("109", "6", "5", "ivan@example.com");
INSERT INTO "Students" VALUES ("110", "1", "6", "judy@example.com");