0% found this document useful (0 votes)
22 views21 pages

Project File

The document is a project report on 'Student Marks Management' prepared by Sonali Tyagi for class XII at Krishna Vidya Niketan. It details the project's purpose, which includes adding, updating, deleting, and searching student records using SQL DBMS and Python. The report also includes acknowledgments, coding examples, and references used in the project.

Uploaded by

tejas.ydv24
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)
22 views21 pages

Project File

The document is a project report on 'Student Marks Management' prepared by Sonali Tyagi for class XII at Krishna Vidya Niketan. It details the project's purpose, which includes adding, updating, deleting, and searching student records using SQL DBMS and Python. The report also includes acknowledgments, coding examples, and references used in the project.

Uploaded by

tejas.ydv24
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

CENTRAL BOARD OF SECONDARY EDUCATION

A
PROJECT REPORT
ON
STUDENT MARKS MANAGEMENT

SUBMITTED TO : SUBMITTED BY:


Mr. Yanni Kumar Dhakwal Sonali Tyagi
CERTIFICATE

This is to certify that SONALI TYAGI of


class XII-MATHS of KRISHNA VIDYA
NIKETAN,MURADNAGAR has prepared the report on
the project entitled
“STUDENTS MARKS MANAGEMENT”.
The report is the result of his efforts
and endeavours. The report is found
worthy of acceptance as final project
report for the Computer Science of
Class XII.

TEACHER’S SIGNATURE :

1
ACKNOWLEDGEMENT

I would like to express a deep sense of thanks and


gratitude to my project guide Mr. Yanni Kumar Dhakwal
Sir for guiding me immensely through the course of the
project. He always evinced keen interest in my work. His
constructive advice and constant motivation have been
responsible for the successful completion of this project.

My sincere thanks goes to Mrs. Kalpana Tyagi , our


Principal Madam, for her coordination in extending
every possible support for completion of this project.

I also thanks to my parents for their motivation and


support. I must thanks to my classmates for their timely
help and support for compilation of this project. Last but
not least, I would like to those who had helped directly
or indirectly towards the completion of this project.

2
INDEX
➢ ABOUT THE PROJECT

➢ FILES IMPORTED IN PROJECT

➢ FUNCTIONS USED IN PROJECT

➢ CODING

➢ OUTPUT

➢ REFERENCE

3
ABOUT THE PROJECT

This project is designed to add a new student,


update marks or details of existing student, delete
details or to delete the whole table; it is also
capable of searching a student’s details.

This project is made by SQL DBMS and Python


connectivity using “[Link]” module.

The module “sys” is used to provide access to


some variables used or maintained by the
interpreter and to functions that interact strongly
with interpreter.

4
Files Imported in Project

1. Import MYSQL for database connectivity

Functions Used in Project

1. connect()- For Database and tables creation

2. cursor()- To execute MySQL queries.

3. fetchall ()- To fetch all the rows.

4. commit()- To execute (commit) current transaction.

5. execute()- To fetch row according to query.

5
CODING

6
#STUDENTS MARKS MANAGEMENT
import [Link] as sql
import sys

#connect to mysql database


db=[Link](host="localhost",user="root",passwd="p
ythonsq234",database="mysql")
cursor = [Link]()
#check database is connected
if db.is_connected():
print("Database connected")

#MENU FOR STUDENT MARKS MANAGEMENT SYSTEM


SOFTWARE
print("********************************************
*****")
print("WELCOME TO MY PROJECT STUDENT MARKS MANAGEMENT
SYSTEM")
print("********************************************
*****")
print()
while(1):
print("1:TO CREATE TABLE FOR THE FIRST TIME")
print("2:TO DISPLAY TABLES OF DATABASE")
print("3:TO SHOW FIELDS OF TABLE")
print("4:TO DISPLAY ALL DATA")
print("5:TO ADD NEW STUDENT")
print("6:TO SEARCH A STUDENT RECORD")
print("7:TO CHANGE MARKS OF STUDENT")
print("8:TO DELETE STUDENT ")

7
print("9:EXIT")
print()
ch=int(input("ENTER YOUR CHOICE"))
#Creating table for the first time
if ch==1:
try:
print(" Creating STUDENT table")
sql = "CREATE TABLE student(ROLL int(4) PRIMARY
KEY,name varchar(15) NOT NULL,class char(3) NOT
NULL,sec char(1),mark1 int(4),mark2 int(4),mark3
int(4),mark4 int(4),mark5 int(4),total int(4),per
float(4));"
[Link](sql)
[Link]()
except:
print("sorry some error occured")
#Displaying tables of database
if ch==2:
try:
[Link]("show tables")
for i in cursor:
print(i)
except:
print("sorry some error occured")
#Displaying
#Tablefields
if ch==3:

try:

8
table=input("enter table name")
[Link]("desc %s"%table)

for i in cursor:
print(i)
except:
print("sorry some error occured")

#Displaying all records of table


if ch==4:
try:
[Link]("select * from student")
data=[Link]()
print("ROLL NO","STUDENT
NAME","CLASS","SECTION","SUBJECT1","SUBJECT2","SUBJEC
T3","SUBJECT4","SUBJECT5","TOTALMARKS","PERCENTAGE")

for i in data:
j=str(i).split()
for k in j:
print(k,end=" ")
print()
except:
print("SORRY SOME ERROR OCCURED")
#inserting new record into
#table
if ch==5:
r=int(input("Enter student roll number"))
name=input("ENTER STUDENT NAME")

9
c=input("ENTER CLASS OF STUDENT")
s=input("ENTER SECTION OF STUDENT")
m1=int(input("ENTER MARKS IN SUBJECT1"))
m2=int(input("ENTER MARKS IN SUBJECT2"))
m3=int(input("ENTER MARKS IN SUBJECT3"))
m4=int(input("ENTER MARKS IN SUBJECT4"))
m5=int(input("ENTER MARKS IN SUBJECT5"))
t=m1+m2+m3+m4+m5
per=t/5
query="insert into student
values(%d,'%s','%s','%s',%d,%d,%d,%d,%d,%d,%d)"%(r,na
me, c,s,m1,m2,m3,m4,m5,t,per)
[Link](query)
print("STUDENT RECORD SAVED IN TABLE")
[Link]()

#searching student details


if ch==6:
print("1:TO SERACH BY STUDENT ROLL NUMBER")
print("2:TO SEARCH BY STUDENT NAME")
c=int(input("ENTER YOUR CHOICE"))
#searching by student roll
#number

if c==1:
try:
roll=int(input("ENTER STUDENT ROLL
NUMBER TO SEARCH"))
qry="select * from student where
roll=%d"%roll

10
[Link](qry)
data=[Link]()
if len(data)==0:
print("STUDENT NOT FOUND")
print("ROLL NO","STUDENT
NAME","CLASS","SECTION","SUBJECT1","SUBJECT2","SUBJEC
T3","SUBJECT4","SUBJECT5","TOTALMARKS","PERCENTAGE")
for i in data:
j=str(i).split()
for k in j:
print(k,end=" ")
print()
except:
print("SORRY SOME ERROR OCCURED")

#searching by student name


if c==2:
try:
name=input("ENTER STUDENT NAME TO SEARCH")
qry="select * from student where
name='%s'"%name

[Link](qry)
data=[Link]
l()
if len(data)==0:
print("STUDENT NOT FOUND")
print("ROLL NO","STUDENT
NAME","CLASS","SECTION","SUBJECT1","SUBJECT2","SUBJEC
T3","SUBJECT4","SUBJECT5","TOTALMARKS","PERCENTAGE")

11
for i in data:
j=str(i).split()
for k in j:
print(k,end=" ")
print()
except:
print("SORRY SOME ERROR OCCURED")

#TO update student marks


if ch==7:
try:
roll=int(input("ENTER ROLL NUMBER OF
STUDENT WHOSE MARKS TO BE UPDATE"))
qry="select * from student where
roll=%d"%roll
[Link](qry)
data=[Link]()
if len(data)==0:
print("STUDENT NOT
FOUND")
else:
m1=int(input("ENTER UPDATED MARKS IN
SUBJECT1"))
m2=int(input("ENTER UPDATED MARKS IN
SUBJECT2"))
m3=int(input("ENTER UPDATED MARKS IN
SUBJECT3"))

12
m4=int(input("ENTER UPDATED MARKS IN
SUBJECT4"))
m5=int(input("ENTER UPDATED MARKS IN
SUBJECT5"))
t=m1+m2+m3+m4+m5
per=t/5
qry="update STUDENT SET
mark1=%d,mark2=%d,mark3=%d,mark4=%d,mark5=%d,total
=%d,per=%d where roll=%d"%(m1,m2,m3,m4,m5,t,per,roll)
[Link](qry)
print("[Link]")
[Link]()
except:
print("SORRY SOME ERROR OCCURED")

# Delete student record from


#table
if ch==8:
try:
roll=int(input("ENTER STUDENT ROLL NUMBER ,YOU
WANT TO DELETE"))
qry="select * from student where
roll=%d"%roll
[Link](qry)
data=[Link]()
if len(data)==0:
print("STUDENT NOT FOUND IN TABLE")
else:
qry="delete from student where
roll=%d"%(roll)

13
[Link](qry)

print("STUDENT RECORD DELETED FROM


TABLE")
[Link]()
except:
print("SORRY SOME ERROR OCCURED")

#Exit from program


if ch==9:
[Link]()

[Link]()

14
OUTPUT

15
16
17
18
19
REFERENCE

• Computer Science with Sumita Arora


• Computer Science with Preeti Arora
• [Link]

20

Common questions

Powered by AI

The project employs simple error-handling strategies using try-except blocks around database operations. In the event of an error, such as failures in executing SQL commands or retrieving data, a message like "sorry some error occurred" is displayed, ensuring the user is informed of the issue without disrupting the entire application flow .

Python facilitates operations through its mysql.connector module, executing CRUD operations on the database. It handles user inputs and outputs in the terminal interface. Additional Python features like Flask or Django could provide a web interface, improving user experience. Implementing Python's pandas library may assist in data analysis and reporting for the records, enhancing functionality .

Scalability could be managed by designing the database schema to include an additional table for subjects, creating a many-to-many relationship between students and subjects. Indexing could optimize larger datasets. For handling additional students, efficient indexing and partitioning techniques can distribute the database load. Additionally, transitioning to a more robust database management system or using cloud services may enhance scalability .

The project uses functions for database connectivity and query execution, which aids modularity. However, the scripting style with long procedural blocks might not directly support maintainability as effectively as a more structured object-oriented approach could. Adopting classes and modules can encapsulate related functionalities, fostering better maintainability and facilitating future expansions .

The system uses SQL primary keys (ROLL int (4) PRIMARY KEY) and commits transactions to ensure data integrity during CRUD operations. SQL constraints like primary keys prevent duplicate entries, and the 'commit()' function is used to finalize transactions ensuring atomicity. However, concurrency control mechanisms aren't specified; hence, additional mechanisms might be required for multi-user environments to maintain consistency .

The project effectively uses SQL for basic CRUD operations with command functions like 'select', 'insert', 'update', and 'delete'. Improvements could include optimizing SQL queries for better performance, using parameterized queries to prevent SQL injection, and incorporating stored procedures for complex operations. Increasing automation via triggers to handle cumulative data changes would also enhance management .

The Student Marks Management project primarily enables users to add new students, update marks or details of existing students, delete student details or the entire table, and search for student details. The implementation utilizes SQL DBMS and Python connectivity via the "mysql.connector" module .

To optimize student record searching, implementing indexed searches on common query fields like roll number and name could improve performance. Incorporating pattern matching queries with SQL LIKE operators for partial searches and including full-text search capabilities to search across multiple columns would enhance the system's search functionality. Using a more user-friendly interface or web-based front-end could also streamline the search process .

The project's code manages user interactions through the terminal interface where users input choices to navigate through different functionalities. It captures input using the 'input()' function and processes integer choices within a while loop to offer repeated prompts until exit. While it relies on basic validation (like checking for menu choices via integer inputs), it lacks sophisticated input validation against invalid data or SQL injection .

The system ensures database connectivity using the 'mysql.connector' module to connect to a MySQL database. The 'connect()' function establishes the connection, while 'cursor()' is used to execute SQL queries. Additionally, 'fetchall()' retrieves data, and 'commit()' executes transactions, ensuring database operations are performed accurately .

You might also like