0% found this document useful (0 votes)
100 views26 pages

College Management System Database Design

Uploaded by

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

College Management System Database Design

Uploaded by

omakshay2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Database Management System

ABL REPORT
On
COLLEGE MANAGEMENT SYSTEM

Submitted for the partial fulfillment of Bachelor of Engineering


By
PRANAV SHARMA ( 1SI22CS132 )
OM AKSHAY ( 1SI22CS119 )
PRAKHAR PRAKASH( 1SI22CS130 )

Under the guidance of


Dr. Srinivasa K
Assistant professor

Department of Computer Science and Engineering


(Program Accredited by NBA)

Siddaganga Institute of Technology, Tumakuru – 572103


(An autonomous institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi,
Accredited by NAAC with 'A++' grade & ISO 9001:2015 Certified)
2024-2025
PROBLEM STATEMENT
Design and Implementation of a College Management System Using a
Relational Database

The goal is to develop a robust College Management System that


efficiently manages various entities and their relationships, such as
departments, professors, courses, students, classes, and enrollments. The
system should enable easy data management, seamless interaction
between entities, and provide a clear structure for college operations.

A typical college comprises various departments, professors, students,


courses, and classes. Managing these entities and their relationships
manually can be inefficient, error-prone, and time-consuming.
Automating this process with a relational database-based management
system can streamline operations, enhance productivity, and ensure data
consistency.

Scope:

The College Management System will provide a relational database


design with the following functionalities:

o Efficient management of departments, professors, students,


courses, classes, and enrollments.

o A seamless and intuitive interface for interacting with the database.

o A backend system that ensures data consistency through


relationships and constraints.
REQUIREMENTS

1. Entity Management:

o Create, read, update, and delete (CRUD) operations for all


entities: Departments, Professors, Students, Courses, Classes,
and Enrollments.

o Maintain data integrity and avoid duplication of records.

2. Relationships Management:

o Manage one-to-many relationships between Departments and


Professors, Courses, and Students.

o Handle many-to-one relationships from Professors and


Courses to Departments, and from Classes to Courses and
Professors.

o Support many-to-many relationships between Students and


Classes via Enrollment.

3. Functional Capabilities:

o Assign professors to departments and classes.

o Allocate courses to departments.

o Allow students to enroll in classes.

o Generate reports to display details of students, professors,


courses, and classes.
4. Data Consistency and Validation:

o Enforce primary and foreign key constraints for relational


mapping.

o Ensure email addresses for professors and students are


unique.
ER MODEL
RELATIONAL MAPPING
DDL STATEMENTS

 Create table Department

CREATE TABLE Department


(
DeptID INT AUTO_INCREMENT PRIMARY KEY,
DeptName VARCHAR(100) NOT NULL,
HOD VARCHAR(100) NOT NULL
);

 Create table Professor

CREATE TABLE Professor


(
ProfID INT AUTO_INCREMENT PRIMARY KEY,
ProfName VARCHAR(100) NOT NULL,
Email VARCHAR(100) UNIQUE NOT NULL,
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID)
);
 Create table Course

CREATE TABLE Course


(
CourseID INT AUTO_INCREMENT PRIMARY KEY,
CourseName VARCHAR(100) NOT NULL,
Credits INT NOT NULL,
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID)
);
 Create table Student

CREATE TABLE Student


(
StudentID INT AUTO_INCREMENT PRIMARY KEY,
StudentName VARCHAR(100) NOT NULL,
Email VARCHAR(100) UNIQUE NOT NULL,
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID)
);

 Create table Class

CREATE TABLE Class (


ClassID INT AUTO_INCREMENT PRIMARY KEY,
ClassName VARCHAR(100) NOT NULL,
CourseID INT,
ProfID INT,
FOREIGN KEY (CourseID) REFERENCES Course(CourseID),
FOREIGN KEY (ProfID) REFERENCES Professor(ProfID) );
 Create table Enrollment

CREATE TABLE Enrollment (


EnrollmentID INT AUTO_INCREMENT PRIMARY KEY,
StudentID INT,
ClassID INT,
FOREIGN KEY (StudentID) REFERENCES Student(StudentID),
FOREIGN KEY (ClassID) REFERENCES Class(ClassID)
);
INSERT STATEMENTS

 INSERT INTO DEPARTMENT

INSERT INTO Department (DeptName, HOD) VALUES


('Computer Science', 'Dr. Alan Turing'),
('Mechanical Engineering', 'Dr. Nikola Tesla'),
('Electrical Engineering', 'Dr. Thomas Edison');

 INSERT INTO PROFESSOR

INSERT INTO Professor (ProfName, Email, DeptID) VALUES


('Dr. Ada Lovelace', 'ada@college.edu', 1),
('Dr. James Watt', 'watt@college.edu', 2),
('Dr. Michael Faraday', 'faraday@college.edu', 3);
 INSERT INTO COURSE

INSERT INTO Course (CourseName, Credits, DeptID) VALUES


('Data Structures', 4, 1),
('Thermodynamics', 3, 2),
('Electromagnetic Theory', 3, 3);

 INSERT INTO STUDENT

INSERT INTO Student (StudentName, Email, DeptID) VALUES


('Alice Johnson', 'alice@college.edu', 1),
('Bob Smith', 'bob@college.edu', 2),
('Charlie Brown', 'charlie@college.edu', 3);

 INSERT INTO CLASS


INSERT INTO Class (ClassName, CourseID, ProfID) VALUES
('Data Structures - Batch A', 1, 1),
('Thermodynamics - Batch B', 2, 2),
('EM Theory - Batch C', 3, 3);

 INSERT INTO ENROLLMENT

INSERT INTO Enrollment (StudentID, ClassID) VALUES


(1, 1),
(2, 2),
(3, 3),
(1, 2),
(2, 3);
QUERIES ON THE DATABASE

TABLE DESCRIPTION:

SHOW TABLES;

DESC department;
DESC professor;

DESC course;

DESC student;
DESC class;

DESC enrolment;

SELECTING TABLES :

SELECT * FROM department;


SELECT * FROM professor;

SELECT * FROM Course;

SELECT * FROM Student;


SELECT * FROM Class;

SELECT * FROM Enrollment;


1. List all students along with their department.

SELECT StudentName, DeptName


FROM Student
JOIN Department ON Student.DeptID = Department.DeptID;

2. List all courses along with their professors

SELECT CourseName, ProfName


FROM Course
JOIN Professor ON Course.DeptID = Professor.DeptID;
3. List all enrollments (students in classes)

SELECT StudentName, ClassName


FROM Enrollment
JOIN Student ON Enrollment.StudentID = Student.StudentID
JOIN Class ON Enrollment.ClassID = Class.ClassID;

4. List all classes along with their courses

SELECT ClassName, CourseName


FROM Class
JOIN Course ON Class.CourseID = Course.CourseID;
5. List professors and the classes they teach

SELECT ProfName, ClassName


FROM Class
JOIN Professor ON Class.ProfID = Professor.ProfID;
PROCEDURES AND TRIGGERS

Procedure: Add a new student

DELIMITER //
CREATE PROCEDURE AddStudent (
IN sName VARCHAR(100),
IN sEmail VARCHAR(100),
IN sDeptID INT
)
BEGIN
INSERT INTO Student (StudentName, Email, DeptID)
VALUES (sName, sEmail, sDeptID);
END //

DELIMITER ;
Procedure : Add Course

DELIMITER //
CREATE PROCEDURE AddCourse ( IN courseName
VARCHAR(100), IN courseCredits INT, IN departmentID INT )
BEGIN
(
SELECT 1 FROM Department WHERE DeptID = departmentID)
THEN
INSERT INTO Course (CourseName, Credits, DeptID) VALUES
(courseName, courseCredits, departmentID
);
ELSE SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Department does not exist. Cannot add
course.';
END IF;
END //
Trigger: Auto Enroll Student

DELIMITER //
CREATE TRIGGER AutoEnrollStudent
AFTER INSERT ON Student
FOR EACH ROW
BEGIN
DECLARE defaultClassID INT;
SET defaultClassID = (SELECT ClassID FROM Class JOIN Course
ON Class.CourseID = Course.CourseID WHERE Course.DeptID =
NEW.DeptID LIMIT 1);
IF defaultClassID IS NOT NULL THEN
INSERT INTO Enrollment (StudentID, ClassID) VALUES
(NEW.StudentID, defaultClassID);
END IF;

END //
CONCLUSION

In conclusion, the development of the college management system


demonstrates the effective utilization of database management systems
(DBMS) to streamline and automate administrative processes. This
system efficiently manages data related to students, courses,
departments, and enrollments, ensuring data consistency, integrity, and
security.

Key features such as the ability to add courses, enroll students


automatically using triggers, and generate detailed reports on academic
activities showcase the system's capability to handle complex
relationships and operations. The use of stored procedures and triggers
enhances the system's functionality by automating repetitive tasks and
maintaining data accuracy.

Overall, the implementation of this system provides a scalable and


robust solution that reduces manual effort, minimizes errors, and
improves the overall efficiency of college operations. This project
highlights the importance of DBMS in modern educational institutions,
laying the groundwork for future enhancements such as real-time
analytics, advanced reporting, and integration with other systems.

By leveraging the principles of DBMS, this project not only fulfills the
immediate requirements of managing a college's database but also serves
as a foundation for further advancements and innovation in educational
management systems.

You might also like