// ================== TASK 1(a) ================== // Database Table Analysis - Primary and Foreign Keys // TABLE: Modules // Entity: Represents academic modules/courses // Primary Key: moduleID // Foreign Keys: None // TABLE: Lecturers // Entity: Represents academic staff/lecturers // Primary Key: lecturerID // Foreign Keys: None // TABLE: Roles // Entity: Represents roles for module staff // Primary Key: roleID // Foreign Keys: None // TABLE: ModuleLecturerRole // Entity: Junction table linking modules, lecturers, and roles // Primary Key: moduleLecturerRoleID // Foreign Keys: // - moduleID (references Modules.moduleID) // - lecturerID (references Lecturers.lecturerID) // - roleID (references Roles.roleID) // ================== TASK 1(b) ================== // Events Registration Database Design // TABLE: Users // Primary Key: userID // Foreign Keys: None // TABLE: Events // Primary Key: eventID // Foreign Keys: None // TABLE: EventRegistrations // Primary Key: registrationID // Foreign Keys: // - userID (references Users.userID) // - eventID (references Events.eventID) // SQL Creation Script: /* CREATE TABLE Users ( userID INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) UNIQUE NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, password VARCHAR(255) NOT NULL, fullName VARCHAR(100) NOT NULL ); CREATE TABLE Events ( eventID INT AUTO_INCREMENT PRIMARY KEY, eventName VARCHAR(100) NOT NULL, eventDate DATETIME NOT NULL, location VARCHAR(200) NOT NULL, description TEXT, capacity INT DEFAULT 0 ); CREATE TABLE EventRegistrations ( registrationID INT AUTO_INCREMENT PRIMARY KEY, userID INT NOT NULL, eventID INT NOT NULL, registrationDate DATETIME DEFAULT CURRENT_TIMESTAMP, status VARCHAR(20) DEFAULT 'Registered', FOREIGN KEY (userID) REFERENCES Users(userID) ON DELETE CASCADE, FOREIGN KEY (eventID) REFERENCES Events(eventID) ON DELETE CASCADE, UNIQUE KEY unique_registration (userID, eventID) ); */