0% found this document useful (0 votes)
184 views19 pages

Student Registration System Project

Uploaded by

ramphool83
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)
184 views19 pages

Student Registration System Project

Uploaded by

ramphool83
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

Pm shri kendriya Vidyalaya

Nashik road camp

STUDENT
REGISTRATION SYSTEM

Academic Year 2024-2025


Project By: - AKHILESH KUMAR
MEENA
th
Class: - 12 B
Subject: - Computer Science
Certificate
This is to certify that Akhilesh Kumar
Meena of class 12th B have successfully
completed their Computer Science
project on “Student Registration System”
under the guidance of Mrs. Pooja
Agarwal during the academic year 2024-
2025 as per the guidelines issued by
Central Board of Secondary Education
(CBSE).

Signature of Subject Teacher

Signature of External Examiner

Signature of Principal
Acknowledgements

I would like to thank our teacher, Mrs.


Pooja Agarwal who gave me this
opportunity to work on this project. I am
very grateful to her for her support and
guidance in completing this project. I
must also thank my parents and friends
for the immense support and help during
this project. Without their help,
completing this project would have been
very difficult.

Thank You
Table of Contents Page no
1. Cover Page 1
2. Certificate 2
3. Acknowledgements 3
4. Table Of Contents 4
5. PROJECT INTRODUCTION 5
6. Objective of the Project 7
7. Source code 9
8. Output 14
9. Data used 17

PROJECT ON STUDENT
REGISTRATION SYSTEM
Students are the most important entity of an institution.
It is, therefore, important to maintain error-free records
of all students. However, sometimes it become difficult to
maintain perfect records of all the students in one go. In
order to achieve flawless management of students details
and to keep data in an organized manner, “Students
Registration System” methodology is adopted.

This methodology serves the following purpose:


1)Enrolling students
2)Updating and displaying student details whenever required
3)Removing undesirable details and records
4)Generating a report of the marks obtained by students in
descending order

When admission is granted to a student in a


school, a detailed record if the student is
created which can be modified or deleted if
the students leaves the school.

This project (front end) has been developed


using python version 3.7.2. The
RDBMS(Relational Database Management
System) used in MySql.

The important modules used in the project


are as follows:
1) main_menu
2) create_table
3) display_struc
4) add_rec
5) update_rec
6) fetch_data
7) delete_rec
8) topper_list

The MySQL table used for storing students


details in this project is:
 student1
Name of the Database: school

About python-MySQL Connectivity

While designing real-life applications, certain


situations arise pertaining to storing some
important and necessary information by the user.
Usually, the data inputted by the user along with
the generated output are displayed but not
stored, since all the program execution takes
place inside the RAM, which is a temporary
memory, and as soon as we close the form, its
contents get erased.
When the application is executed the second
time, it requires a new set of inputs from the
user. This limitation can be overcome by sending
the output generated and saving the input
fetched from the user in a database created at
the back-end of the application. The input is
fetched from the user using Python Interface.

Database( The Back-end)

While working with an application, it is required


to save data permanently on some secondary
storage device, which is usually the hard disk, so
that data can be stored on it for further
reference, modification, deletion and retrieval. An
application usually stores a lot of data in the form
of a database which is not directly accessible to
the user. This database is used by the application
to give suitable response to the user. This
database is called Back-end Database.
WHY PYTHON

Python is a flexible, portable, easy to learn and


modifiable language. So, we are integrating
MySQL with Python interface for executing any
database applications.

CODE
#Student Registration System

def main_menu():
ch = 'y'
while ch == 'y':
print("***********STUDENT REGISTRATION SYSTEM*************")
print("1: To show databases")
print("2: To create a table")
print("3: To show tables present in the database")
print("4: To display structure of the table")
print("5: To add a record in the table")
print("6: To update a record in the table")
print("7: To delete a record from the table")
print("8: To display all the records from the table")
print("9: To sort the data in descending order of total")
print("10: To quit")
choice = int(input("Enter your choice"))
if choice == 1:
show_database()
elif choice == 2:
create_table()
elif choice == 3:
showtables()
elif choice == 4:
display_struc()
elif choice == 5:
add_rec()
elif choice == 6:
update_rec()
elif choice == 7:
delete_rec()
elif choice == 8:
fetch_data()
elif choice == 9:
topper_list()
elif choice == 10:
print("Exiting")
break
else:
print("Wrong input")
ch = input("Do you want to continue")

def show_database():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "")
cursor = [Link]()
[Link]("show databases")
for x in cursor:
print(x)
except:
print("Error in connection")

def create_table():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password =
"", database = "school")
cursor = [Link]()
[Link]("create table student1(rollno int primary key,\ name
varchar(20), stream varchar(10), total\ int, grade varchar(3), Class int)")
print("Table created")
except:
print("Error in connection")

def showtables():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
[Link]("show tables")
for x in cursor:
print(x)
except:
print("Error in connection")

def display_struc():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
[Link]("desc student1")
for x in cursor:
print(x)
except:
print("Error in connection")

def add_rec():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
rno = int(input("Enter roll number"))
nm = input("Enter name")
st = input("Enter stream")
tot = int(input("Enter total"))
gr = input("Enter grade")
C = int(input ("Enter class"))
sql_query = "insert into student1 values(%s,%s,%s,%s,%s,%s)"
val = (rno,nm,st,tot,gr,C)
[Link](sql_query,val)
[Link]()
print("Record added")
except:
[Link]()
print("Error, Record not added")

def update_rec():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
rno = int(input("Enter rollno"))
tot = int(input("Enter total"))
sql_query = "Update student1 set total = %s where rollno = %s"
val = (tot,rno)
[Link](sql_query,val)
print([Link], "record updated")
[Link]()
except:
[Link]()
print("Record not updated")

def delete_rec():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
rno = int(input("Enter rollno"))
sql_query = "delete from student1 where rollno = %s"
[Link](sql_query,(rno,))
print([Link], "record deleted")
[Link]()
except:
[Link]()
print("Record not deleted")
def fetch_data():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
[Link]("SELECT * FROM student1")
records = [Link]()
for x in records:
print(x[0],x[1],x[2],x[3],x[4],x[5])
except:
print("Error, unable to fetch data")

def topper_list():
import [Link]
try:
db = [Link](host = "localhost", user = "root", password = "",
database = "school")
cursor = [Link]()
[Link]("select * from student1 order by total desc")
records = [Link]()
for x in records:
print(x[0],x[1],x[2],x[3],x[4],x[5])
except:
print("Error, unable to sort")

main_menu()
once the above code is written and all modules are created,
upon execution, it will show the following output window:
In the above project, we have used formatting (%sign) with
print()statement, which we will discuss now.
FORMATTING DATA

Formatting Data with print() statement


Usually we align strings to the left and numbers to the
right. Python supports formatting values into strings.

SYMBOL DESCRIPTION
1) %c character
2) %s string
3) %d signed decimal
integer
4) %i integer
5) %u unsigned
decimal int
6) %o octal integer
7) %f floating
number
8) %e exponential
notation
9) %E exponential
notation
10)%x hexadecimal
lowercase

11)%X hexadecimal
uppercase

NOTE : The % operator is sometimes called


string interpolation since it interpolates literal text
and converted values.

Common questions

Powered by AI

The 'student1' table provides essential functionalities including storing students' roll numbers, names, streams, total marks, grades, and class numbers. It facilitates adding, updating, and deleting student records, sorting students based on total marks, and displaying student details. These functionalities are central to managing student information systematically .

Sorting student data in descending order of total marks is significant for identifying top-performing students and analyzing overall academic performance efficiently. It allows the institution to generate ranked reports which can be used for awarding honors and providing counseling. It also aids in performance monitoring and strategic planning for academic improvements .

The main goal of implementing a Student Registration System is to maintain error-free records of students in an organized manner. This is achieved by enrolling students, updating and displaying their details when required, removing undesirable records, and generating reports of students' marks in descending order .

The 'main_menu' function facilitates user interaction by providing options to perform various tasks on the database, such as showing databases, creating tables, displaying table structures, adding and updating records, and more. It prompts users to enter their choice and executes corresponding functions, thereby allowing easy navigation and operation within the system .

Formatted print statements enhance readability and presentation by allowing specific alignment and representation of data types in output, such as aligning strings to the left and numbers to the right. It facilitates clear visualization and interpretation of data, making information understandable at a glance. The use of symbols like %s and %d helps in accurate and professional display of varying data types .

When output data is stored in RAM, it is temporary and gets erased once the application is closed, requiring new inputs each time the program runs. The system overcomes this limitation by using a backend database (MySQL) to permanently store input and output data on secondary storage devices like a hard disk. This enables data persistence and accessibility for future operations .

The 'fetch_data' function in the system connects to the MySQL database, executes a SELECT statement to retrieve all records from the 'student1' table, and prints each student's details. It ensures that users can access and view comprehensive student data, which is essential for monitoring academic and personal records over time .

Integrating MySQL with Python enhances the functionality of the Student Registration System by allowing data to be stored permanently in a relational database for further reference, modification, and retrieval. Python provides a flexible and modifiable interface to interact with MySQL, facilitating the management of student data through operations like adding, updating, deleting, and fetching records .

Python might be chosen for developing a student registration system due to its flexibility, portability, and ease of learning. It supports integration with MySQL, allowing developers to manage database operations efficiently. Python also offers built-in functionalities for string manipulation, error handling, and a simple interface for rapid application development .

Error handling in the Student Registration System is crucial for maintaining data integrity and ensuring smooth operation. In functions like 'add_rec' and 'delete_rec', error handling is implemented using try-except blocks. If an error occurs during database operations, the system rolls back changes to prevent partial data updates and prints an error message to inform the user. This robust error management prevents potential data inconsistencies and helps maintain system reliability .

You might also like