Skip to content

aarushi-deshmukh/student-database-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Student Academic Management System

A modular C++ application connected to a MySQL database, designed to manage student records, course enrollments, and academic performance. The system supports user authentication (admin/student), GPA calculation, and role-based access to academic data.


Features

  • Role-Based Login (Admin / Student)
  • Student Management: Add and view students
  • Course Management: Add and list courses with credit weightage
  • Enrollments: Enroll students in courses with marks
  • GPA Calculation: Weighted GPA based on course credits and marks
  • MySQL Database with structured relationships
  • OOP Principles: Modular C++ code using classes
  • Secure DB Configuration using external file

Tech Stack

  • C++ (OOP, STL)
  • MySQL (Relational DB)
  • MySQL Connector/C++
  • Command-line Interface
  • Modular Source Structure (Headers + Source Files)

Project Structure

├── src/
│   ├── main.cpp
│   ├── User.h / .cpp
│   ├── Student.h / .cpp
│   ├── Course.h / .cpp
│   ├── Enrollment.h / .cpp
│   ├── GPAEngine.h / .cpp
│   ├── Menu.h / .cpp
│   ├── ConfigLoader.h
│   ├── Database.h / .cpp
├── db_config.txt      ← 🔐 Not included in GitHub
├── README.md
├── .gitignore
└── Makefile / CMakeLists.txt (optional)

Setup Instructions

1. Install MySQL Connector for C++

  • Windows: Download

  • Linux (Debian):

    sudo apt install libmysqlcppconn-dev

2. Create MySQL Database

CREATE DATABASE StudentDB;
USE StudentDB;

CREATE TABLE Users (
    user_id INT PRIMARY KEY AUTO_INCREMENT,
    username VARCHAR(50) UNIQUE,
    password VARCHAR(255),
    role ENUM('admin', 'student')
);

CREATE TABLE Students (
    student_id INT PRIMARY KEY,
    name VARCHAR(100),
    age INT,
    email VARCHAR(100),
    user_id INT,
    FOREIGN KEY (user_id) REFERENCES Users(user_id)
);

CREATE TABLE Courses (
    course_id INT PRIMARY KEY,
    course_name VARCHAR(100),
    credits INT
);

CREATE TABLE Enrollments (
    student_id INT,
    course_id INT,
    marks FLOAT,
    PRIMARY KEY (student_id, course_id),
    FOREIGN KEY (student_id) REFERENCES Students(student_id),
    FOREIGN KEY (course_id) REFERENCES Courses(course_id)
);

3. Create db_config.txt

This file should NOT be pushed to GitHub. Add it to .gitignore.

host=127.0.0.1
user=root
password=yourpassword
database=StudentDB

4. Add Sample Users

INSERT INTO Users (username, password, role) VALUES
('admin1', 'adminpass', 'admin'),
('student1', 'studpass', 'student');

5. Build the Project

Using g++:

g++ -std=c++17 src/*.cpp -o student_sys -lmysqlcppconn
./student_sys

Or use Makefile / CMakeLists.txt if available.


Sample Login

  • Admin

    • Username: admin1
    • Password: adminpass
  • Student

    • Username: student1
    • Password: studpass

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages