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

CREATE TABLE "Student_Enrolment" (
"student_enrolment_id" INT,
"semester_id" INT,
PRIMARY KEY ("student_enrolment_id")
);

CREATE TABLE "Students" (
"student_id" INT UNIQUE,
"first_name" VARCHAR(80),
"middle_name" VARCHAR(40),
"last_name" VARCHAR(40),
"email_address" VARCHAR(40),
"date_left" DATETIME,
PRIMARY KEY ("student_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 "Student_Enrolment" VALUES ("1", "101");
INSERT INTO "Student_Enrolment" VALUES ("2", "102");
INSERT INTO "Student_Enrolment" VALUES ("3", "103");
INSERT INTO "Student_Enrolment" VALUES ("4", "104");
INSERT INTO "Student_Enrolment" VALUES ("5", "105");
INSERT INTO "Students" VALUES ("1", "John", "A.", "Smith", "john.smith@example.com", "2019-05-15 00:00:00");
INSERT INTO "Students" VALUES ("2", "Jane", "B.", "Doe", "jane.doe@example.com", "2018-12-20 00:00:00");
INSERT INTO "Students" VALUES ("3", "John", "A.", "Smith", "john.smith2@example.com", "2018-12-20 00:00:00");
INSERT INTO "Students" VALUES ("4", "Alice", "C.", "Johnson", "alice.johnson@example.com", "2020-06-10 00:00:00");
INSERT INTO "Students" VALUES ("5", "Bob", "D.", "Brown", "bob.brown@example.com", "2021-01-05 00:00:00");
INSERT INTO "Students" VALUES ("6", "Charlie", "E.", "Davis", "charlie.davis@example.com", "NULL");
INSERT INTO "Students" VALUES ("7", "Diana", "F.", "Evans", "diana.evans@example.com", "2017-11-30 00:00:00");
INSERT INTO "Students" VALUES ("8", "Eve", "G.", "Foster", "eve.foster@example.com", "2017-11-30 00:00:00");
INSERT INTO "Students" VALUES ("9", "Frank", "H.", "Green", "frank.green@example.com", "2019-08-25 00:00:00");
INSERT INTO "Students" VALUES ("10", "Grace", "I.", "Hill", "grace.hill@example.com", "2018-01-15 00:00:00");