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

Comp Project

The document outlines the development of a School Management System (SMS) using a MySQL database and Python programming. It includes the creation of essential tables for users, students, and teachers, along with sample data insertion and user authentication processes. The system aims to streamline school operations by enabling secure management of student and teacher information through a structured database approach.

Uploaded by

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

Comp Project

The document outlines the development of a School Management System (SMS) using a MySQL database and Python programming. It includes the creation of essential tables for users, students, and teachers, along with sample data insertion and user authentication processes. The system aims to streamline school operations by enabling secure management of student and teacher information through a structured database approach.

Uploaded by

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

ENIOR SECONDA

E S RY
AL SC
ND HO
EE OL
GR

SCHOOL MANAGEMENT SYSTEM

SUBMITTED BY:
NAME: JOHN JABEZ N.
CLASS: 12 SCI
ROLL NO:
TO: SIR DAMIAN
ENIOR SECONDA
E S RY
AL SC
ND HO
EE OL
GR

LIBRARY MANAGEMENT SYSTEM

SUBMITTED BY:
NAME: AANSH PANDEY
CLASS: 12 SCI
ROLL NO:
TO: SIR DAMIAN
ENIOR SECONDA
E S RY
AL SC
ND HO
EE OL
GR

SCHOOL ACCOUNTS
MANAGEMENT SYSTEM

SUBMITTED BY:
NAME: REWARD RAI
CLASS: 12 SCI
ROLL NO:
TO: SIR DAMIAN
ACKNOWLEDGMENT
I would like to express my sincere gratitude to everyone who has
contributed to the success of this project.
First and foremost, I would like to thank my teacher/mentor, sir
Damian , for his continuous support, guidance, and valuable feedback
throughout the development of this project.

I would also like to extend my appreciation to draw.io , whose


resources and tools made it possible to bring this project to life.
Thank you all for your contribution to this project. Your support has
made a lasting impact on its success.
ACKNOWLEDGMENT
I would like to express my sincere gratitude to everyone who has
contributed to the success of this project.
First and foremost, I would like to thank my teacher/mentor, sir
Damian , for his continuous support, guidance, and valuable feedback
throughout the development of this project.

I would also like to extend my appreciation to draw.io , whose


resources and tools made it possible to bring this project to life.
Thank you all for your contribution to this project. Your support has
made a lasting impact on its success.
CONTENT
CONTEXT
school management system

DATABASE CREATION
The first step involves creating the
school_management database, which
1
serves as the container for all tables
and data. Using CREATE DATABASE
ensures that the system can store TABLE CREATION FOR
information such as user credentials, USERS
student, and teacher details.
2 The users table is created to store
login credentials, such as username,
password, and designation (Admin,
Teacher, Other). This table is essential
TABLE CREATION for managing access control within
FOR STUDENTS the system, ensuring users can log in
The student table stores essential 3 based on their roles.
information about students, including
student_id, name, age, grade, email,
and phone. This table is key to
maintaining student records, TABLE CREATION
facilitating management of their FOR TEACHERS
academic and personal information.
4 The teacher table holds data about
teachers, including teacher_id, name,
subject, salary, and contact details.
This table helps manage teacher
INSERTING SAMPLE records and their associated data
DATA such as salary and subject expertise.

Sample data is inserted into the users,


student, and teacher tables to test the
5
database structure. This step provides
real entries that simulate the system's
operation, allowing for verification of DATA RETRIEVAL FOR
the data flow and integrity. VERIFICATION
6 Finally, SELECT queries are used to
retrieve data from the users, student,
[email protected] and teacher tables. This step
confirms that the data was inserted
correctly and ensures the system is
ready for integration with
application logic (e.g., your Python
code).
INTRODUCION
A School Management System (SMS) relies on a
structured database to manage student, teacher, and
user data efficiently. The database stores essential
information like user credentials, student records, and
teacher details, ensuring smooth school operations.
Key steps include:
1. Creating a database to store all information.
2. Defining tables for users, students, and teachers.
3. Inserting sample data for testing.
4. Verifying data through queries to ensure proper
functionality.
This system forms the foundation for managing school
data, supporting administrative tasks, and enabling
future enhancements like reporting and communication
tools.
SQL CODE
CREATE DATABASE school_management;
USE school_management;

CREATE TABLE users (


user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL,
designation ENUM('Admin', 'Teacher', 'Other') NOT
NULL
);

CREATE TABLE student (


student_id VARCHAR(20) PRIMARY KEY,
name VARCHAR(100) NOT NULL,
father_name VARCHAR(100),
age INT CHECK (age BETWEEN 5 AND 25),
grade VARCHAR(10) NOT NULL,
email VARCHAR(100) UNIQUE,
phone VARCHAR(15),
school_name VARCHAR(100)
);

CREATE TABLE teacher (


teacher_id VARCHAR(20) PRIMARY KEY,
name VARCHAR(100) NOT NULL,
subject VARCHAR(100),
email VARCHAR(100) UNIQUE,
phone VARCHAR(15),
salary DECIMAL(10, 2) CHECK (salary > 0)
);
SQL CODE
INSERT INTO users (username, password, designation)
VALUES
('admin1', 'Admin@1234', 'Admin'),
('teacher1', 'Teach@2024', 'Teacher'),
('teacher2', 'Teach@5678', 'Teacher');

INSERT INTO student (student_id, name, father_name,


age, grade, email, phone, school_name)
VALUES
('S001', 'John Doe', 'Michael Doe', 16, '10th',
'[email protected]', '9876543210', 'Green Valley
School'),
('S002', 'Emma Stone', 'Robert Stone', 14, '9th',
'[email protected]', '8765432109', 'Blue Ridge
Academy'),
('S003', 'Liam Smith', 'David Smith', 17, '12th',
'[email protected]', '7654321098', 'Sunshine
High');

INSERT INTO teacher (teacher_id, name, subject,


email, phone, salary)
VALUES
('T001', 'Alice Brown', 'Mathematics',
'[email protected]', '6543210987', 55000.50),
('T002', 'Mark Johnson', 'Science',
'[email protected]', '5432109876', 62000.75),
('T003', 'Sophia Lee', 'History',
'[email protected]', '4321098765', 58000.25);
STEP WISE
EXPLANATION‌

The first part creates a database named school_management if it
doesn't already exist.
The USE school_management; command ensures that all
subsequent operations are performed within this database.

A table named users is created to store user login credentials and


their designations.
It includes:
user_id: An auto-incrementing primary key.
username: A unique identifier for users.
password: The password for login.
designation: Defines whether the user is an Admin, Teacher, or
Other.
The use of ENUM ensures only specific values are allowed in the
designation field
This table stores details for students.
It includes fields like:
student_id: A unique identifier for each student.
name, father_name, age, grade, email, phone, and school_name.

This table stores details for teachers.


It includes fields like:
teacher_id: A unique identifier for each teacher.
name, subject, email, phone, and salary.
Inserting Sample Data into the users Table

Inserting Sample Data into the student Table

Inserting Sample Data into the student Table

fetch the datas


OUTPUT...
OF SQL CODE‌

FLOWCHART
OF PYTHON CODE‌

DESCRIPTION ‌
OF THE FLOW CHART‌
Establishing MySQL Connection
The Python program begins by establishing a
connection to a local MySQL database
(school_management) using mysql.connector. It uses
the provided credentials (username and password) to
authenticate and connect to the database.

Defining a Password Strength Checker


The function is_strong_password(password)checks if
the password meets the following conditions:
At least 8 characters long
Contains at least one uppercase letter, one
lowercase letter, one digit, and one special
character from a predefined list (@$!%*?&).

User Registration
In the register_user() function, a new user is
prompted to enter a username and password. The
password is validated using the is_strong_password
function. If the password is strong and confirmed by
the user, the user’s information (username, password,
and designation) is inserted into the users table in
the database.

User Login
In the user_login() function, users are prompted to
enter their username and password. The system checks
the users table in the database to verify the
credentials. If the login is successful, the user’s
designation (Admin/Teacher) is returned to control
the access level.
Admin Operations
Once logged in as an Admin, the user can choose
from various options:
Add a new student: The admin can enter student
details (name, ID, age, grade, etc.) which are
then inserted into the student table in the
database.
View all students: The admin can view a list of
all students stored in the student table.
Add a new teacher: The admin can enter teacher
details (name, ID, subject, salary, etc.) which
are inserted into the teacher table in the
database.
View all teachers: The admin can view all teachers
in the teacher table.

Teacher Operations
Once logged in as a Teacher, the user can perform
limited actions:
View all students: Teachers can view the list of all
students stored in the student table.
View all teachers: Teachers can also view the list of
all teachers stored in the teacher table.

System Exit
After completing tasks, both Admins and Teachers can
exit the system, which closes the connection to the
MySQL database and ends the session.
STEP WISE
EXPLANATION‌

PYTHON
‌CODE‌

import mysql.connector
# Establishing a connection to the MySQL database
conn = mysql.connector.connect(
host='localhost',
user='root', # Replace with your MySQL username
password='himynameisjohn', # Replace with your MySQL password
database='school_management'
)
cursor = conn.cursor()
# Function to check password strength
def is_strong_password(password):
if len(password) < 8:
return False
has_upper = has_lower = has_digit = has_special = False
special_characters = "@$!%*?&"
for char in password:
if char.isupper():
has_upper = True
elif char.islower():
has_lower = True
elif char.isdigit():
has_digit = True
elif char in special_characters:
has_special = True
return has_upper and has_lower and has_digit and has_special
# Function to register a new user
def register_user():
print("\n--- User Registration ---")
username = input("Enter a new username: ")
while True:
password = input("Enter a strong password: ")
if is_strong_password(password):
confirm_password = input("Confirm your password: ")
if password == confirm_password:
designation = input("Enter your designation (Admin/Teacher/Other):
").capitalize()
cursor.execute(
"INSERT INTO users (username, password, designation) VALUES (%s, %s,
%s)",
(username, password, designation)
)
conn.commit()
print("User registered successfully!")
break
else:
print("Passwords do not match. Try again.")
else:
print("Password must be at least 8 characters long and include uppercase,
lowercase, digits, and special characters.")
# Function for user login
def user_login():
print("\n--- User Login ---")
username = input("Enter your username: ")
password = input("Enter your password: ")
cursor.execute("SELECT designation FROM users WHERE username=%s AND
password=%s", (username, password))
result = cursor.fetchone()
if result:
print(f"\nLogin successful! Welcome, {username}.")
designation = result[0]
return designation
else:
print("\nInvalid username or password!")
return None
# Function to add a new student
def add_student():
print("\n--- Add Student ---")
student_id = input("Enter student ID: ")
name = input("Enter student name: ")
father_name = input("Enter father's name: ")
age = int(input("Enter student age: "))
grade = input("Enter student grade: ")
email = input("Enter student email: ")
phone = input("Enter student phone: ")
school_name = input("Enter school name: ")
cursor.execute("""
INSERT INTO student (student_id, name, father_name, age, grade, email, phone,
school_name)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s)
""", (student_id, name, father_name, age, grade, email, phone, school_name))
conn.commit()
print("Student added successfully!")
# Function to view all students
def view_students():
print("\n--- View Students ---")
cursor.execute("SELECT * FROM student")
records = cursor.fetchall()
for record in records:
print(record)
# Function to add a new teacher
def add_teacher():
print("\n--- Add Teacher ---")
teacher_id = input("Enter teacher ID: ")
name = input("Enter teacher name: ")
subject = input("Enter subject: ")
email = input("Enter teacher email: ")
phone = input("Enter teacher phone: ")
salary = float(input("Enter salary: "))
cursor.execute("""
INSERT INTO teacher (teacher_id, name, subject, email, phone, salary)
VALUES (%s, %s, %s, %s, %s, %s)
""", (teacher_id, name, subject, email, phone, salary))
conn.commit()
print("Teacher added successfully!")
# Function to view all teachers
def view_teachers():
print("\n--- View Teachers ---")
cursor.execute("SELECT * FROM teacher")
records = cursor.fetchall()
for record in records:
print(record)
# Main function to run the School Management System
def main():
print("Welcome to the School Management System")
# User registration if needed
register = input("\nDo you want to register a new user? (yes/no): ").lower()
if register == 'yes':
register_user()
# User login
designation = user_login()
if designation is None:
return
# Display menu options based on designation
while True:
if designation == 'Admin':
print("\nAdmin Menu:\n1. Add Student\n2. View Students\n3. Add
Teacher\n4. View Teachers\n5. Exit")
choice = input("Enter your choice: ")
if choice == '1':
add_student()
elif choice == '2':
view_students()
elif choice == '3':
add_teacher()
elif choice == '4':
view_teachers()
elif choice == '5':
break
elif designation == 'Teacher':
print("\nTeacher Menu:\n1. View Students\n2. View Teachers\n3. Exit")
choice = input("Enter your choice: ")
if choice == '1':
view_students()
elif choice == '2':
view_teachers()
elif choice == '3':
break
if __name__ == "__main__":
main()
# Close the database connection
cursor.close()
conn.close()
OUTPUT...
OF PYTHON CODE‌

CONCLUSION
The School Management System developed in Python with
a MySQL database integration is a practical demonstration
of how database management can be efficiently applied in
educational institutions. This system enables secure user
registration, login, and role-based access, allowing
administrators to manage student and teacher data
effectively. By leveraging Python for backend logic and
MySQL for persistent data storage, this system highlights
the importance of database-driven applications in
streamlining school management processes. It also
demonstrates fundamental concepts like user
authentication, password security, and data manipulation,
making it a valuable project for both learning and real-
world application.

You might also like