The School Management System is a Python command-line application that simplifies the management of student records, subjects, and marks. This system offers an efficient way to maintain and access essential data related to students and subjects in an educational institution.
Table of Contents
The School Management System is a command-line application designed to help you manage student records, subjects, and marks efficiently. This system provides functionalities for:
- Adding, updating, and deleting student records.
- Adding, updating, and deleting subject records.
- Adding, updating, and deleting marks for students in specific subjects.
- Viewing student details, marks, and filtering students based on various criteria.
To set up the required database and tables for the School Management System, follow these steps:
1. Clone the Repository: Begin by cloning the repository to your local machine. Use the following command:
git clone https://github.com/AllTechz/school-management-system.git
cd school-management-system
3. Install Required Python Packages: Install the necessary Python packages, primarily the mysql-connector-python
. You can do this by running:
pip install mysql-connector-python
-- Create the school_management database
CREATE DATABASE school_management;
-- Switch to the new database
USE school_management;
-- Create the Students table
CREATE TABLE Students (
student_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
date_of_birth DATE,
contact_info VARCHAR(20) NOT NULL,
class VARCHAR(10) NOT NULL
);
-- Create the Subjects table
CREATE TABLE Subjects (
subject_id INT AUTO_INCREMENT PRIMARY KEY,
subject_name VARCHAR(255) NOT NULL
);
-- Create the Marks table
CREATE TABLE Marks (
mark_id INT AUTO_INCREMENT PRIMARY KEY,
student_id INT,
subject_id INT,
mark DECIMAL(5,2),
date_recorded DATE
);
These SQL commands will create the necessary database and tables for the School Management System to function.
These tables serve as the backbone of the application, enabling the seamless management of student records, subjects, and marks. Here's a brief overview of each table's purpose:
-
The
Students
table stores student information, including names, dates of birth, contact details, and class levels. Each student is uniquely identified by astudent_id
. -
The
Subjects
table keeps track of the subjects offered at your educational institution. It usessubject_id
for identification. -
The
Marks
table records students' marks in various subjects, including the student'sstudent_id
, the subject'ssubject_id
, the mark itself, and the date when the mark was recorded.
By executing these SQL commands, you establish the foundation for efficient school management and academic record-keeping.
Before you can run the School Management System, you need to configure the MySQL connector with your database credentials. Follow these steps to set it up:
-
Open the
main.py
file: In themain.py
file, look for the following lines of code near the beginning of the script:db = mysql.connector.connect( host="localhost", user="root", password="12345", database="school_management" )
-
Modify the MySQL Connection Parameters: Replace the default values for
user
,password
, and other connection parameters with your MySQL database credentials. You'll need to change theuser
andpassword
values to match your MySQL username and password. Update thehost
if your MySQL server is running on a different host or port.For example:
db = mysql.connector.connect( host="your-mysql-server", user="your-username", password="your-password", database="school_management" )
Make sure to replace
"your-mysql-server"
,"your-username"
, and"your-password"
with your specific MySQL server details. -
Populate the Database with Sample Data (Optional):
In this repository, you'll find a Python script named
populate_database.py
that you can use to add sample data to your database. It's a helpful tool for testing and understanding how the School Management System works.-
Before using this script, you need to chnage the values of database credentials in
populate_database.py
. -
To use the script, run the following command in your terminal:
python populate_database.py
-
The script will populate the database with sample student records, subjects, and marks.
-
python school_management.py
With the database and tables in place, the application is ready to help you streamline your school's administrative tasks and academic management.
By including the additional information, users gain a deeper understanding of the purpose of each table and how they contribute to the functionality of the School Management System.
Upon running the program, you will have access to a menu-driven interface. You can navigate through the available options to perform various actions, such as managing student records, subjects, and marks. The system provides detailed feedback on the actions you perform.
- Student Management: Add, update, and delete student records.
- Subject Management: Add, update, and delete subject records.
- Marks Management: Add, update, and delete marks for students in specific subjects.
- View Information: View student details, marks, and filter students based on criteria like class, name, and average percentage.
The main menu provides the following options:
- Student Management: Access student management features.
- Subject Management: Access subject management features.
- Marks Management: Access marks management features.
- View Information: Access features to view student and subject information.
- Exit: Close the program.
Under Student Management, you can perform the following actions:
- Add Student Record: Add a new student record to the system.
- Update Student Information: Update an existing student's information.
- Delete Student Record: Delete a student's record from the system.
- Back to Main Menu: Return to the main menu.
Subject Management offers the following options:
- Add Subject: Add a new subject to the system.
- Update Subject: Update an existing subject's name.
- Delete Subject: Delete a subject from the system.
- Back to Main Menu: Return to the main menu.
In the Marks Management section, you can perform the following actions:
- Add Marks: Add marks for a student in a specific subject.
- Update Marks: Update the marks for a student in a specific subject.
- Delete Marks: Delete marks for a student in a specific subject.
- Back to Main Menu: Return to the main menu.
View Information provides the following options:
- View Student Details: View detailed information about a specific student.
- View Student Marks: View marks for a specific student.
- Filter Students by (class, name, avg percentage): Filter and view a list of students based on class, name, or average percentage.
- View all Subjects: View a list of all subjects.
- Back to Main Menu: Return to the main menu.
We welcome contributions to this project. If you have any improvements, bug fixes, or new features to add, please feel free to create a pull request on our GitHub repository.
This School Management System is licensed under the MIT License. You are free to use and modify the code as per the terms of this license.