0% found this document useful (0 votes)
14 views51 pages

Student Database Management System Project

The document is a project report for a Student Database Management System developed by students Ojas Pandey and Nick Sharda at Delhi Public School Prayagraj for the academic year 2025-26. It outlines the project's objectives, proposed system features, and the System Development Life Cycle (SDLC) phases, emphasizing the use of Python and MySQL for efficient management of student records. The report also includes acknowledgments, certificates of completion, and a detailed table of contents.

Uploaded by

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

Student Database Management System Project

The document is a project report for a Student Database Management System developed by students Ojas Pandey and Nick Sharda at Delhi Public School Prayagraj for the academic year 2025-26. It outlines the project's objectives, proposed system features, and the System Development Life Cycle (SDLC) phases, emphasizing the use of Python and MySQL for efficient management of student records. The report also includes acknowledgments, certificates of completion, and a detailed table of contents.

Uploaded by

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

DELHI PUBLIC SCHOOL PRAYAGRAJ

ACADEMIC YEAR : 2025-26

PROJECT REPORT ON:


*STUDENT DATABASE MANAGEMENT SYSTEM*

ROLL NO :
NAME : OJAS PANDEY
CLASS : XII
SUBJECT : COMPUTER SCIENCE
SUB CODE : 083

PROJECT GUIDE: Mrs Smita Verma, PGT (CS)

1
DELHI PUBLIC SCHOOL PRAYAGRAJ
ACADEMIC YEAR : 2025-26

PROJECT REPORT ON:


*STUDENT DATABASE MANAGEMENT SYSTEM*

ROLL NO :
NAME : NICK SHARDA
CLASS : XII
SUBJECT : COMPUTER SCIENCE
SUB CODE : 083

PROJECT GUIDE: Mrs Smita Verma PGT (CS)

CERTIFICATE
2
This is to certify that Student OJAS PANDEY, CBSE

Roll No: _______________ has successfully completed the

project Work entitled STUDENT DATABASE

MANAGEMENT SYSTEM in the subject Computer

Science (083) laid down in the regulations of CBSE for the

purpose of Practical Examination in Class XII to be held in

Delhi Public School Prayagraj on______________.

(Smita Verma)
PGT Comp Sci

Signature of External Examiner


Name: _______________________
Examiner Number: _______________

CERTIFICATE

3
This is to certify that Student NICK SHARDA CBSE

Roll No:_________________ has successfully completed the

project Work entitled *STUDENT DATABASE

MANAGEMENT SYSTEM* in the subject Computer

Science (083) laid down in the regulations of CBSE for the

purpose of Practical Examination in Class XII to be held

in Delhi Public School Allahabad on______________.

(Smita Verma)
PGT Comp Sci

Signature of External Examiner


Name: _______________________
Examiner Number: _______________

TABLE OF CONTENTS [ T O C]

SRNO. DESCRIPTION PAGE NO

4
01 ACKNOWLEDGEMENT 04

02 INTRODUCTION 05

03 OBJECTIVES OF THE PROJECT 05

04 PROPOSED SYSTEM 06

SYSTEM DEVELOPMENT LIFE CYCLE


05 07
(SDLC)
PHASES OF SYSTEM DEVELOPMENT LIFE
06 08
CYCLE

07 FLOW CHART 15

08 OUTPUT 16

09 INSTALLATION PROCEDURE 20

10 TESTING 23

HARDWARE AND SOFTWARE


11 25
REQUIREMENTS

12 BIBLIOGRAPHY 26

ACKNOWLEDGEMENT

5
My sincere thanks to MRS SMITA VERMA, A guide,
Mentor all the above a friend, who critically reviewed my
project and helped in solving each and every problem,
occurred during implementation of the project

The guidance and support received from all the members who
contributed and who are contributing to this project, was vital
for the success of the project. I am grateful for their constant
support and help.

PROJECT ON student MANGEMENT SYSTEM

INTRODUCTION:

6
The Student Database Management System is a Python-MySQL

based application designed to manage and organize student

information efficiently. It provides a structured and reliable way to

store, retrieve, update, and delete student records while ensuring data

accuracy and user authentication.

Through the integration of Python for frontend logic and MySQL for

backend storage, the system delivers a practical, real-world

demonstration of database handling, data validation, and user-level

security. The inclusion of login and signup functionality enhances

authorized access and ensures that only verified users can manage

sensitive student data.

OBJECTIVES OF THE PROJECT

The primary objective of this project is to develop a secure and user-friendly


system that simplifies the management of student records. It aims to:

 Implement user authentication through login and signup modules.

7
 Enable efficient storage and retrieval of student information using a
MySQL database.

 Provide essential operations such as insert, update, display, and delete


student data.

 Ensure data accuracy and validity through checks on admission


number, marks, DOB, and mobile number.

 Demonstrate the practical use of Python-MySQL connectivity, SQL


queries, and error handling.

Overall, the project seeks to replicate how a real institution maintains student
records, combining simplicity with reliability.

PROPOSED SYSTEM:
The proposed Student Database Management System aims to replace the

traditional, manual methods of maintaining student records with a structured,

automated, and reliable digital platform. This system focuses on improving the

8
speed, accuracy, and accessibility of academic information while ensuring

security and ease of use for authorized users.

The core idea behind the system is to integrate Python and MySQL to create

an efficient environment for storing and managing student details. The system

introduces a robust login and signup mechanism so that only registered users

with valid credentials can operate the application. This ensures controlled

access, preventing misuse of sensitive academic data.

The system provides all essential management functions such as adding new

student records, updating existing information, retrieving complete student

lists, searching specific entries, and deleting outdated or incorrect data.

These operations help maintain a clean and accurate database, reducing

redundancy and manual errors. Each record includes crucial fields such as

Admission Number, Name, Class, Mobile Number, Date of Birth, and Marks,

ensuring that all relevant academic and personal information is stored

systematically.

In addition to basic CRUD operations, the system emphasizes data validation

to enhance reliability. Inputs such as mobile number format, date of birth, and

marks are checked to avoid incorrect entries. This ensures that the database

remains consistent and free from invalid data.

Overall, the proposed system aims to provide a practical, real-world solution for

managing school or institutional records in an organized manner. By combining

simplicity in interface with power in backend processing, the system serves as

9
an efficient digital alternative to manual record-keeping, ultimately saving time,

reducing effort, and improving accuracy in student data management.

SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)

The systems development life cycle is a project management technique


that divides complex projects into smaller, more easily managed segments or
phases. Segmenting projects allows managers to verify the successful
completion of project phases before allocating resources to subsequent phases.

Software development projects typically include initiation, planning, design,


development, testing, implementation, and maintenance phases. However, the
phases may be divided differently depending on the organization involved.

10
For example, initial project activities might be designated as request,
requirements-definition, and planning phases, or initiation, concept-
development, and planning phases. End users of the system under development
should be involved in reviewing the output of each phase to ensure the system is
being built to deliver the needed functionality.

PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE

INITIATION PHASE

The Initiation Phase begins when a business sponsor identifies a need or an


opportunity.
The purpose of the Initiation Phase is to:

❖ Identify and validate an opportunity to improve business accomplishments the


organization or a deficiency related to a business need.

❖ Identify significant assumptions and constraints on solutions to that need.

❖ Recommend the exploration of alternative concepts and methods to satisfy the


need including questioning the need for technology, i.e., will a change in the business
process offer a solution?

❖ Assure executive business and executive technical sponsorship. The Sponsor


designates a Project Manager and the business need is documented in a Concept
Proposal. The Concept Proposal includes information about the business process and
the relationship to the Agency/Organization.

❖ Infrastructure and the Strategic Plan. A successful Concept Proposal results in a


Project Management Charter which outlines the authority of the project manager to
begin the project.

11
Careful oversight is required to ensure projects support strategic business objectives
and resources are effectively implemented into an organization's enterprise
architecture. The initiation phase begins when an opportunity to add, improve, or
correct a system is identified and formally requested through the presentation of a
business case. The business case should, at a minimum, describe a proposal’s purpose,
identify expected benefits, and explain how the proposed system supports one of the
organization’s business strategies. The business case should also identify alternative
solutions and detail as many informational, functional, and network requirements as
possible.

SYSTEM CONCEPT DEVELOPMENT PHASE

The System Concept Development Phase begins after a business need or opportunity
is validated by the Agency/Organization Program Leadership and the
Agency/Organization CIO.

The purpose of the System Concept Development Phase is to:

❖ Determine the feasibility and appropriateness of the alternatives.

❖ Identify system interfaces.

❖ Identify basic functional and data requirements to satisfy the business need.

❖ Establish system boundaries; identify goals, objectives, critical success factors,


and performance measures.

12
❖ Evaluate costs and benefits of alternative approaches to satisfy the basic
functional requirements

❖ Assess project risks

❖ Identify and initiate risk mitigation actions, and develop high-level technical
architecture, process models, data models, and a concept of operations. This phase
explores potential technical solutions within the context of the business need.

❖ It may include several trade-off decisions such as the decision to use COTS
software products as opposed to developing custom software or reusing software
components, or the decision to use an incremental delivery versus a complete, onetime
deployment.

❖ Construction of executable prototypes is encouraged to evaluate technology to


support the business process. The System Boundary Document serves as an important
reference document to support the Information Technology Project Request (ITPR)
process.

❖ The ITPR must be approved by the State CIO before the project can move
forward.

13
PLANNING PHASE

The planning phase is the most critical step in completing


development, acquisition, and maintenance projects. Careful
planning, particularly in the early stages of a project, is necessary to
coordinate activities and manage project risks effectively. The depth
and formality of project plans should be commensurate with the
characteristics and risks of a given project. Project plans refine the
information gathered during the initiation phase by further identifying
the specific activities and resources required to complete a project.

A critical part of a project manager’s job is to coordinate discussions


between user, audit, security, design, development, and network
personnel to identify and document as many functional, security, and
network requirements as possible. During this phase, a plan is
developed that documents the approach to be used and includes a
discussion of methods, tools, tasks, resources, project schedules, and
user input. Personnel assignments, costs, project schedule, and target
dates are established.

A Project Management Plan is created with components related to


acquisition planning, configuration management planning, quality

14
assurance planning, concept of operations, system security,
verification and validation, and systems engineering management
planning.

REQUIREMENTS ANALYSIS PHASE

This phase formally defines the detailed functional user requirements using
high-level requirements identified in the Initiation, System Concept, and
Planning phases. It also delineates the requirements in terms of data, system
performance, security, and maintainability requirements for the system. The
requirements are defined in this phase to a level of detail sufficient for systems
design to proceed. They need to be measurable, testable, and relate to the
business need or opportunity identified in the Initiation Phase. The requirements
that will be used to determine acceptance of the system are captured in the Test
and Evaluation Masterplan.

The purposes of this phase are to:

❖ Further define and refine the functional and data requirements and
document them in the Requirements Document,

❖ Complete business process reengineering of the functions to be supported


(i.e., verify what information drives the business process, what
information is generated, who generates it, where does the information
go, and who processes it)

❖ Develop detailed data and process models (system inputs, outputs, and
the process.

15
❖ Develop the test and evaluation requirements that will be used to
determine acceptable system performance.

DESIGN PHASE

The design phase involves converting the informational, functional,


and network requirements identified during the initiation and planning
phases into unified design specifications that developers use to script
programs during the development phase. Program designs are
constructed in various ways. Using a top-down approach, designers
first identify and link major program components and interfaces, then
expand design layouts as they identify and link smaller subsystems
and connections. Using a bottom-up approach, designers first identify
and link minor program components and interfaces, then expand
design layouts as they identify and link larger systems and
connections. Contemporary design techniques often use prototyping
tools that build mock-up designs of items such as application screens,
database layouts, and system architectures. End users, designers,
developers, database managers, and network administrators should
review and refine the prototyped designs in an iterative process until
they agree on an acceptable design. Audit, security, and quality
assurance personnel should be involved in the review and approval
process. During this phase, the system is designed to satisfy the
16
functional requirements identified in the previous phase. Since
problems in the design phase could be very expensive to solve in the
later stage of the software development, a variety of elements are
considered in the design to mitigate risk. These include:

❖ Identifying potential risks and defining design features.

❖ Performing a security risk assessment.

❖ Developing a conversion plan to migrate current data to the new system.

❖ Determining the operating environment.

❖ Defining major subsystems and their inputs and outputs.

❖ Allocating processes to resources.

❖ Preparing detailed logic specifications for each software module. The


result is a draft System Design Document which captures the preliminary design
for the system.

❖ Everything requiring user input or approval is documented and reviewed


by the user. Once these documents have been approved by the Agency CIO and
Business Sponsor, the final System Design Document is created to serve as the
Critical/Detailed Design for the system.

❖ This document receives a rigorous review by Agency technical and


functional representatives to ensure that it satisfies the business requirements.

17
Concurrent with the development of the system design, the Agency Project
Manager begins development of the Implementation Plan, Operations and
Maintenance Manual, and the Training Plan.

DEVELOPMENT PHASE

The development phase involves converting design specifications into


executable programs. Effective development standards include requirements
that programmers and other project participants discuss design specifications
before programming begins. The procedures help ensure programmers
clearly understand program designs and functional requirements.
Programmers use various techniques to develop computer programs. The
large transaction-oriented programs associated with financial institutions
have traditionally been developed using procedural programming techniques.
Procedural programming involves the line-by-line scripting of logical
instructions that are combined to form a program. Effective completion of
the previous stages is a key factor in the success of the Development phase.
The Development phase consists of:

❖ Translating the detailed requirements and design into system components.


❖ Testing individual elements (units) for usability.
❖ Preparing for integration and testing of the IT system.

INTEGRATION AND TEST PHASE

❖ Subsystem integration, system, security, and user acceptance testing is


conducted during the integration and test phase. The user, with those

18
responsible for quality assurance, validates that the functional requirements, as
defined in the functional requirements document, are satisfied by the developed
or modified system. OIT Security staff assess the system security and issue a
security certification and accreditation prior to installation/implementation.

Multiple levels of testing are performed, including:

❖ Testing at the development facility by the contractor and possibly


supported by end users

❖ Testing as a deployed system with end users working together with


contract personnel

❖ Operational testing by the end user alone performing all functions.


Requirements are traced throughout testing, a final Independent Verification &
Validation evaluation is performed and all documentation is reviewed and
accepted prior to acceptance of the system.
IMPLEMENTATION PHASE

This phase is initiated after the system has been tested and accepted by the user.
In this phase, the system is installed to support the intended business functions.
System performance is compared to performance objectives established during
the planning phase. Implementation includes user notification, user training,
installation of hardware, installation of software onto production computers, and
integration of the system into daily work processes. This phase continues until
the system is operating in production in accordance with the defined user
requirements.

19
OPERATIONS AND MAINTENANCE PHASE

The system operation is ongoing. The system is monitored for continued


performance in accordance with user requirements and needed system
modifications are incorporated. Operations continue as long as the system can
be effectively adapted to respond to the organization’s needs. When
modifications or changes are identified, the system may re-enter the planning
phase.

The purpose of this phase is to:

❖ Operate, maintain, and enhance the system.


❖ Certify that the system can process sensitive information.
❖ Conduct periodic assessments of the system to ensure the functional
requirements continue to be satisfied.
❖ Determine when the system needs to be modernized, replaced, or retired.

FLOW CHART OF THE PROJECT

START PYTHON

CREATION OF TABLE
20
USERS, STUDENTS
PROGRAM EXECUTION BY
(“1. NAME”)
(“[Link]”)
(“3. STREAM”)
(“4. MARKS_1”)
(“5. MARKS_2)
(“6. MARKS_3”)

SOURCE CODE
(“7. DOB”)
(“8. MOBILE_NO”)
import [Link] as sqlcon
from datetime import datetime,date

#Establishing Database connection


try:
mycon = [Link](
host="localhost",
user="root",
password="335ef6c47cec",

21
database="STUDENT_MANAGER")
cursor = [Link]()

# Create USERS table if it doesn't exist


[Link]("CREATE TABLE IF NOT EXISTS USERS (username
VARCHAR(50) PRIMARY KEY,password VARCHAR(100) NOT
NULL,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP)")
[Link]()

# Create STUDENTS table if it doesn't exist


[Link]("CREATE TABLE IF NOT EXISTS STUDENTS
(ADMIN_NO INT(4) PRIMARY KEY, NAME VARCHAR(50) NOT NULL,
CLASS INT(2) NOT NULL, STREAM VARCHAR(10) NOT NULL,
MARKS_1 INT(3) NOT NULL, MARKS_2 INT(3) NOT NULL, MARKS_3
INT(3) NOT NULL, DOB DATE NOT NULL, MOBILE_NO CHAR(10)
UNIQUE NOT NULL)")
[Link]()

except [Link] as e:
print(f"Database connection error: {e}")
exit()

print("-"*100)
print("*"*30, "STUDENT DATABASE MANAGEMENT SYSTEM","*"*30)
print("-"*100)
print("\n")

#Fuction to check password


def pass_check(passwrd):

22
upper = False
lower = False
digit = False
special =False
spec_symb = ['!','@','#','$','%','&','-','`','~','|','/']
for x in passwrd:
if [Link]():
upper = True
elif [Link]():
lower = True
elif [Link]():
digit = True
elif x in spec_symb:
special = True
if upper == False:
return False,"Password must contain atleast one digit, one uppercase, one
lowercase, digit, and one special symbol and should be greater than 8 digits
elif lower == False:
return False,"Password must contain atleast one digit, one uppercase, one
lowercase, digit, and one special symbol and should be greater than 8 digits"
elif digit == False:
return False,"Password must contain atleast one digit, one uppercase, one
lowercase, digit, and one special symbol and should be greater than 8 digits"
elif special == False:
return False, "Password must contain atleast one digit, one uppercase, one
lowercase, digit, and one special symbol and should be greater than 8 digits"

return True, ""

23
#Function to signup
def signup():
print(" "*15 + "SIGN UP")
print("="*50)

username = input("Enter a username: ").strip()


if not username:
print("Username cannot be empty!")
return False

# Check if username already exists


[Link]("SELECT username FROM USERS WHERE username =
%s", (username,))
if [Link]():
print(f"Username '{username}' already exists! Please choose a different
username.")
return False

password = input("Enter a password: ")


if len(password) > 8:
is_valid, msg = pass_check(password)
if not is_valid:
f"✗ {msg}"
confirm_password = input("Confirm password: ")
if password != confirm_password:
print("Passwords do not match!")
return False

# Storing password

24
try:
[Link]("INSERT INTO USERS (username, password) VALUES
(%s, %s)",
(username, password))
[Link]()
print("\n✓ Account created successfully! Please login.")
return True
except [Link] as e:
print(f"Error creating account: {e}")
return False

#Function to login
def login():
print("\n" + "="*50)
print(" "*17 + "LOGIN")
print("="*50)

max_attempts = 3
attempts = 0

while attempts < max_attempts:


username = input("Enter username: ").strip()
password = input("Enter password: ")

[Link]("SELECT username FROM USERS WHERE username =


%s AND password = %s",
(username, password))
result = [Link]()

25
if result:
print("\n✓ Login successful!")
print(f"Welcome, {username}!")
return True
else:
attempts += 1
remaining = max_attempts - attempts
if remaining > 0:
print(f"\n✗ Invalid username or password! {remaining} attempt(s)
remaining.")
else:
print("\n✗ Maximum login attempts reached. Exiting...")
return False

return False

#Function to verify admin_no


def check_admin_exists(Admin_No):
sql = "SELECT EXISTS(SELECT 1 FROM STUDENTS WHERE
Admin_No = %s)"
[Link](sql, (Admin_No,))
result = [Link]()
return result[0] == 1

#Function to verify DateOfBirth


def validate_dob(DOB):
try:
dob_date = [Link](DOB,"%Y-%m-%d")

26
cur_date = [Link]()

#Check if date isn't in future


if dob_date>cur_date:
return False, "Date of birth can't be in future!"

#Verifying the age


age = cur_date.year - dob_date.year
if (cur_date.month, cur_date.day) < (dob_date.month, dob_date.day):
age -= 1

if age<5:
return False, "Student is too young to be a student!"
elif age>20:
return False, "Student is too old to be a student!"
return True, f"Valid (Age: {age} years)"
except:
return False, "Invalid date format! Use YYYY-MM-DD (e.g., 2010-03-
15)"

#Creating functions to SAVE data


def SAVE():
try:
n = int(input("Number of records to be entered: "))
if n <= 0:
print("Please enter a valid positive number!")
return
except ValueError:

27
print("Invalid input! Please enter a number.")
return

for x in range(n):
print(f"\n--- Record {x+1} of {n} ---")
try:
Admin_No = int(input("Enter the Admission Number of Student: "))
if check_admin_exists(Admin_No):
print(f"✗ Error: Admission Number {Admin_No} already exists!")
continue

Name = input("Enter the Name of the Student: ").strip()


if not Name:
print("✗ Name cannot be empty!")
continue

Class = int(input("Enter the Class of the student: "))


if Class not in range(1,13):
print("✗ Invalid class! Must be between 1 and 12.")
continue

Stream = input("Enter the Stream of the Student: ").strip().upper()

Marks_1 = int(input("Enter the Marks of 1st Subject: "))


if Marks_1 not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
continue

Marks_2 = int(input("Enter the Marks of 2nd Subject: "))

28
if Marks_2 not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
continue

Marks_3 = int(input("Enter the Marks of 3rd Subject: "))


if Marks_3 not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
continue

DOB = input("Enter Date of Birth of student (Format YYYY/MM/DD): ")


is_valid, message = validate_dob(DOB)
if is_valid == False:
print(f"✗ {message}")
continue

Mobile_No = input("Enter the registered Mobile number: ")


if len(Mobile_No)<10:
print("✗ Invalid Mobile Number! Must have 10 digits")
return
elif Mobile_No[0] not in [6,7,8,9]:
print("✗ Invalid Mobile Number! Must start from 6,7,8 or 9")
return
elif not Mobile_No.isdigit():
print("✗ Mobile number must contain only digits!")
return

Data = (Admin_No,Name,Class,Stream,Marks_1,Marks_2,Marks_3,DOB,Mobile_No)
sql = "INSERT INTO STUDENTS VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)"

29
[Link](sql,Data)
[Link]()
print(f"✓ Record for {Name} added successfully!")

except ValueError:
print("✗ Invalid input! Please enter correct data types.")
continue
except [Link] as e:
print(f"✗ Database error: {e}")
continue

#Creating functions to UPDATE data


def UPDATE():
try:
Admin_No = int(input("Enter the Admission Number whose data is to be
updated: "))
except ValueError:
print("✗ Invalid input! Please enter a valid admission number.")
return

#Verifying Admin_No EXISTS (corrected logic)


if not check_admin_exists(Admin_No):
print(f"✗ Error: Admission Number {Admin_No} does not exist!")
return

#Asking which field to update

30
upd_field = input("Enter the field to update
(name/class/stream/marks_1/marks_2/marks_3/dob/mobile_number):
").strip().lower()

try:
#For NAME
if upd_field == "name":
upd_value = input("Enter the New Name: ").strip()
if not upd_value:
print("✗ Name cannot be empty!")
return
sql = "UPDATE STUDENTS SET NAME = %s WHERE Admin_No = %s"

#For CLASS
elif upd_field == "class":
upd_value = int(input("Enter the New Class: "))
if upd_value not in range(1,13):
print("✗ Invalid class! Must be between 1 and 12.")
return
sql = "UPDATE STUDENTS SET CLASS = %s WHERE Admin_No = %s"

#For STREAM
elif upd_field == "stream":
upd_value = input("Enter the New Stream: ").strip().upper()
sql = "UPDATE STUDENTS SET STREAM = %s WHERE Admin_No = %s"

#For MARKS OF 1ST SUBJECT


elif upd_field == "marks_1":
upd_value = int(input("Enter the New Marks for Subject 1: "))

31
if upd_value not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
return
sql = "UPDATE STUDENTS SET MARKS_1 = %s WHERE Admin_No = %s"

#For MARKS OF 2ND SUBJECT


elif upd_field == "marks_2":
upd_value = int(input("Enter the New Marks for Subject 2: "))
if upd_value not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
return
sql = "UPDATE STUDENTS SET MARKS_2 = %s WHERE Admin_No = %s"

#For MARKS OF 3RD SUBJECT


elif upd_field == "marks_3":
upd_value = int(input("Enter the New Marks for Subject 3: "))
if upd_value not in range(0,101):
print("✗ Invalid Marks! Must be between 0 and 100.")
return
sql = "UPDATE STUDENTS SET MARKS_3 = %s WHERE Admin_No = %s"

#For DOB
elif upd_field == "dob":
upd_value = input("Enter Date of Birth of student (Format YYYY/MM/DD): ")
is_valid, message = validate_dob(upd_value)
if is_valid == False:
print(f"✗ {message}")
return
sql = "UPDATE STUDENTS SET DOB = %s WHERE Admin_No = %s"
32
#For Mobile Number
elif upd_field == "mobile_no":
upd_value = input("Enter the registered Mobile number: ")
if len(upd_value)<10:
print("✗ Invalid Mobile Number! Must have 10 digits")
return
elif upd_value[0] not in ['6','7','8','9']:
print("✗ Invalid Mobile Number! Must start from 6,7,8 or 9")
return
elif not upd_value.isdigit():
print("✗ Mobile number must contain only digits!")
return
sql = "UPDATE STUDENTS SET MOBILE_NO = %s WHERE Admin_No = %s"
else:
print("✗ Field doesn't exist in the database!")
return

[Link](sql, (upd_value, Admin_No))


[Link]()
print("✓ Record updated successfully!")

except ValueError:
print("✗ Invalid input! Please enter correct data type.")
except [Link] as e:
print(f"✗ Database error: {e}")

#Creating functions to DISPLAY data

33
def SHOW():
[Link]("SELECT * FROM STUDENTS")
data = [Link]()

if not data:
print("\n" + "!"*50)
print("No records found in the database.")
print("!"*50 + "\n")
return

print("\n" + "="*125)
print("\n" + "="*125)
print(f"{'ADMISSION NO':<15} {'STUDENT NAME':<25} {'CLASS':<8}
{'DOB':<12} {'MOBILE NO':<12} {'STREAM':<15} {'MARKS 1':<10}
{'MARKS 2':<10} {'MARKS 3':<10} {'TOTAL':<10} {'AVG':<8}")
print("="*125)

for row in data:


total = row[4] + row[5] + row[6]
avg = total / 3
print(f"{row[0]:<15} {row[1]:<25} {row[2]:<8} {row[-2]:<12} {row[-
2]:<12} {row[3]:<15} {row[4]:<10} {row[5]:<10} {row[6]:<10} {total:<10}
{avg:<8.2f}")
print("="*125)
print(f"Total Records: {len(data)}")
print("="*125 + "\n")

#Creating functions to DELETE data


def DELETE():

34
try:
Admin_No = int(input("Enter the Admission Number whose data is to be
deleted: "))
except ValueError:
print("✗ Invalid input! Please enter a valid admission number.")
return

#Verifying Admin_No EXISTS (corrected logic)


if not check_admin_exists(Admin_No):
print(f"✗ Error: Admission Number {Admin_No} does not exist!")
return

# Show the record before deletion


[Link]("SELECT * FROM STUDENTS WHERE Admin_No = %s",
(Admin_No,))
record = [Link]()
print(f"\nRecord to be deleted: {record[1]} (Class: {record[2]}, Stream:
{record[3]})")

confirm = input("Are you sure you want to delete this record? (yes/no):
").strip().lower()
if confirm != 'yes':
print("✗ Deletion cancelled.")
return

try:
sql = "DELETE FROM STUDENTS WHERE ADMIN_NO = %s"
val = (Admin_No,)
[Link](sql,val)

35
[Link]()
print("✓ Record deleted successfully!")
except [Link] as e:
print(f"✗ Database error: {e}")

#Main Program with Authentication

if mycon.is_connected():
print("-"*100)
print("✓ Connection established successfully!")
print("-"*100)

# Authentication Menu
while True:
print("\n" + "="*50)
print("1. Login")
print("2. Sign Up")
print("3. Exit")
print("="*50)

try:
auth_choice = int(input("Enter your choice: "))
except ValueError:
print("✗ Invalid choice! Please enter a number.")
continue

if auth_choice == 1:
if login():
break
36
else:
[Link]()
exit()
elif auth_choice == 2:
signup()
elif auth_choice == 3:
print("Goodbye!")
[Link]()
exit()
else:
print("✗ Invalid choice!")

# Main Menu (After successful login)


print("-"*100)
print("Press 1 to INSERT Data")
print("Press 2 to SHOW Data")
print("Press 3 to UPDATE Data")
print("Press 4 to DELETE Data")
print("Press 5 to EXIT")
print("-"*100)
while True:
try:
ch = int(input("\nEnter your choice: "))
except ValueError:
print("✗ Invalid choice! Please enter a number.")
continue
if ch==1:
SAVE()
elif ch==2:
37
SHOW()
elif ch==3:
UPDATE()
elif ch==4:
DELETE()
elif ch==5:
print("\n✓ Thank you for using Student Database Management
System!")
[Link]()
break
else:
print("✗ Invalid Choice! Please select 1-5.")
else:
print("✗ Connection Error")
print("-"*100)

38
output
# SIGN UP

39
# LOG IN

# Leaving Name column blank while SIGN UP

# Not using strong password while SIGN UP

40
# Using Wrong Username or Password while LOG IN

#SAVEING DATA

41
# If using preexisting Admission Number

# If NAME is left as blank

#If entered invalid CLASS

42
#If entered invalid Marks

#If entered invalid DOB

#SHOW/DISPLAY data

43
#

OUTPUT

44
45
INSTALLATON PROCEDURE

charity management system: -


-----------------------------------------------
Pre-Requisites: -
----------------------------
1. You have to have the following softwares for the
successful running of this software; which are

I) Python (Only for the First time), it is


downloadable from '[Link]'.

II) MySQL (Only for the First time), it is


downloadable from '[Link]'.

Installation: -
-------------------
1. There will be two folders namely 'TABLEE Files'
and 'MAIN files'.
2. The folder 'TABLEE Files' will contain the source
code of the software in python language. If you are
running the software by the 3rd step mentioned below
you have to pre install the following modules: -

A.) [Link]
46
B.) IMPORT time

3. Open the files in any python editors and run it to


start and work on the software.

4. The folder '6054' will contain two files namely


'[Link]' and 'Tables_in_mysql.exe'.

5. First run the 'Tables_in_mysql.exe' to create the


tables in MySQL.

6. Then run the file '[Link]' to start and work on


the software.

47
TESTING

Software Testing is an empirical investigation conducted to


provide stakeholders with information about the quality of the product
or service under test, with respect to the context in which it is
intended to operate. Software Testing also provides an objective,
independent view of the software to allow the business to appreciate
and understand the risks at implementation of the software. Test
techniques include, but are not limited to, the process of executing a
program or application with the intent of finding software bugs.
It can also be stated as the process of validating and verifying
that a software program/application/product meets the business and
technical requirements that guided its design and development, so that
it works as expected and can be implemented with the same
characteristics. Software Testing, depending on the testing method

48
employed, can be implemented at any time in the development
process, however the most test effort is employed after the
requirements have been defined and coding process has been
completed.

CODE COMPLETENESS EVALUATION

White box testing methods can also be used to evaluate the


completeness of a test suite that was created with black box testing
methods. This allows the software team to examine parts of a system
that are rarely tested and ensures that the most important function
points have been tested.

Two common forms of code coverage are:


❖ Function Coverage: Which reports on functions executed and
❖ Statement Coverage: Which reports on the number of lines
executed to complete the test.
They both return coverage metric, measured as a percentage

49
HARDWARE AND SOFTWARE REQUIREMENTS

[Link] SYSTEM : WINDOWS 7 AND ABOVE

II. PROCESSOR : PENTIUM(ANY) OR AMD

EQUIVALENT

III. MOTHERBOARD : 1.845 OR 915,995 FOR PENTIUM

IV. RAM : 512 MB+

V. Hard disk : SATA 40 GB OR ABOVE

VI. CD/DVD r/w multi drive combo: (If back up required)

VII. FLOPPY DRIVE 1.44 MB : (If Backup required)

VIII. MONITOR 14.1 or 15 -17 inch

IX. Key board and mouse

X. Printer : required

50
SOFTWARE REQUIREMENTS:

I. Windows OS
II. Python

BIBLIOGRAPHY

1. Computer science With Python - Class XII By: Sumita


Arora
2. Internet

***

GROUP MEMBERS:

51

You might also like