0% found this document useful (0 votes)
5 views11 pages

Online Examination System r2[1]

The document outlines the structure of an online examination system, including the creation of tables for Admins, Examinations, Online_Examination, Questions, Results, Students, and Subjects. Each table includes primary keys, foreign keys, and relevant attributes for managing the examination process. The design ensures data integrity and relationships between different entities in the system.

Uploaded by

jr3620
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views11 pages

Online Examination System r2[1]

The document outlines the structure of an online examination system, including the creation of tables for Admins, Examinations, Online_Examination, Questions, Results, Students, and Subjects. Each table includes primary keys, foreign keys, and relevant attributes for managing the examination process. The design ensures data integrity and relationships between different entities in the system.

Uploaded by

jr3620
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Online

examination
system

Review-2
E-R DIAGRAM
RELATIONAL DIAGRAM
1.Admins:
CREATE TABLE Admins ( admin_id INT PRIMARY KEY
AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL);
2.Examinations:
CREATE TABLE Examinations (
exam_id INT PRIMARY KEY AUTO_INCREMENT,
subject_id INT,
exam_name VARCHAR(100) NOT NULL,
exam_date DATETIME,
total_marks INT NOT NULL,
admin_id INT,
FOREIGN KEY (subject_id) REFERENCES Subjects(subject_id) ON DELETE CASCADE,
FOREIGN KEY (admin_id) REFERENCES Admins(admin_id) ON DELETE SET NULL
);
3.Online_Examination:
CREATE TABLE Online_Examination (
exam_id INT,
student_id INT,
status ENUM('Not Started', 'Ongoing', 'Completed') DEFAULT 'Not Started',
start_time DATETIME,
end_time DATETIME,
PRIMARY KEY (exam_id, student_id),
FOREIGN KEY (exam_id) REFERENCES Examinations(exam_id) ON DELETE CASCADE,
FOREIGN KEY (student_id) REFERENCES Students(student_id) ON DELETE CASCADE
);
4.Questions:
CREATE TABLE Questions (
question_id INT PRIMARY KEY AUTO_INCREMENT,
exam_id INT,
question_text TEXT NOT NULL,
option_a VARCHAR(255),
option_b VARCHAR(255),
option_c VARCHAR(255),
option_d VARCHAR(255),
correct_option ENUM('A', 'B', 'C', 'D') NOT NULL,
marks INT NOT NULL,
FOREIGN KEY (exam_id) REFERENCES Examinations(exam_id) ON DELETE CASCADE
);
);
5.Results:
CREATE TABLE Results (
result_id INT PRIMARY KEY AUTO_INCREMENT,
student_id INT,
exam_id INT,
total_score INT DEFAULT 0,
status ENUM('Passed', 'Failed') NOT NULL,
FOREIGN KEY (student_id) REFERENCES Students(student_id) ON DELETE CASCADE,
FOREIGN KEY (exam_id) REFERENCES Examinations(exam_id) ON DELETE CASCADE
);
6.Students:

Students Table
CREATE TABLE Students (
student_id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL
);
7.Subjects:
-- Subjects Table
CREATE TABLE Subjects (
subject_id INT PRIMARY KEY AUTO_INCREMENT,
subject_name VARCHAR(100) NOT NULL,
description TEXT
};
);
THANK
YOU

You might also like