Benovin J Rejol Class 12 (CS) MPCC Project
Benovin J Rejol Class 12 (CS) MPCC Project
PADUR
COMPUTER SCIENCE
EXAM MARKS MANAGEMENT
SYSTEM
2024 - 2025
INTRODUCTION
OBJECTIVES
SYSTEM REQUIREMENTS
SYSTEM DESIGN
IMPLEMENTATION
CONCLUSION
BIBLIOGRAPHY
INTRODUCTION
Python
Python is a high-level, interpreted scripting
language developed in the late 1980s by Guido
van Rossum at the National Research Institute
for Mathematics and Computer Science in the
Netherlands. The initial version was published at
the alt.sources newsgroup in 1991, and version
was released in 1994.
Python 2.0 was released in 2000, and the 2.x
versions were the prevalent releases until
December 2008. At that time, the development
team made the decision to release version 3.0,
which contained a few relatively small but
significant changes that were not backward
compatible with the 2.x versions. Python 2 and 3
are very similar, and some features of Python 3
have been backported to Python 2. But in
general, they remain not quite compatible.
Both Python 2 and 3 have continued to be
maintained and developed, with periodic release
updates for both. As of this writing, the most
recent versions available are 2.7.15 and 3.6.5.
However, an official End of life of January
1,2020 has been established for Python 2, after
which time it will no longer be maintained. If
you are a newcomer to Python, it is
recommended that you focus on Python 3, as this
tutorial will do.
Python is still maintained by a core development
team at the Institute, and Guido is still in charge,
having been given the title of BDFL (Benevolent
Dictator For Life) by the Python community.
The name Python, by the way, derives not from
the snake, but from the British comedy troupe
Monty Python’s Flying Circus, of which Guido
was, and presumably still is, a fan. It is common
to find references to Monty Python sketches and
movies scattered throughout the Python
documentation.
Python is Popular
Python has been growing in popularity over the
last few years. The 2018 Stack Overflow
Developer Survey ranked Python as the 7th most
popular and the number one most wanted
technology of the year. World-class software
development countries around the globe use
Python every single day. According to research
by Dice Python is also one of the hottest skills to
have and the most popular programming
language in the world based on the Popularity of
programming Language Index.
Python is Interpreted
Many languages are compiled, meaning the
source code you create needs to be translated
into machine code, the language of your
computer’s processor, before it can be run.
Programs written in an interpreted language are
passed straight to an interpreter that runs them
directly.
This makes for a quicker development cycle
because you just type in your code and run it,
without the intermediate compilation step.
One potential downside to interpreted languages
is execution speed. Programs that are compiled
into the native language of the computer
processor tend to run more quickly than
interpreted programs. For some applications that
are particularly computationally intensive, like
graphics processing or intense number
crunching, this can be limiting.
In practice, however, for most programs, the
difference in execution speed is measured in
milliseconds, or seconds at most, and not
appreciably noticeable to a human user. The
expediency of coding in an interpreted language
is typically worth it for most applications.
Python is Free
The Python interpreter is developed under an
OSI-approved open-source license, making it
free to install, use, and distribute, even for
commercial purposes.
A version of the interpreter is available for
virtually any platform there is, including all
flavours of Unix, Windows, mac OS,
smartphones and tablets, and probably anything
else you ever heard of. A version even exists for
the half dozen people remaining who use OS/2.
Python is Portable
Because Python code is interpreted and not
compiled into native machine instructions, code
written for one platform will work on any other
platform that has the Python interpreter installed.
(This is true of any interpreted language, not just
Python.)
Python is Simple
As programming languages go, Python is
relatively uncluttered, and the developers have
deliberately kept it that way.
A rough estimate of the complexity of a
language can be gleaned from the number of
keywords or reserved words in the language.
These are words that are reserved for special
meaning by the compiler or interpreter because
they designate specific built-in functionality of
the language.
Python 3 has 33 keywords, and Python 2 has 31.
By contrast, C++ has 62, Java has 53, and Visual
Basic has more than 120, though these latter
examples probably vary somewhat by
implementation or dialect.
MySQL:
Database Management System & Types of
DBMS
A Database Management System(DBMS) is a
software application that interacts with the user,
applications and the database itself to capture
and analyse data. The data stored in the
database can be modified, retrieved and deleted,
and can be of any type like strings, numbers,
images etc.
Types of DBMS
There are mainly 4 types of DBMS, which are
Hierarchical, Relational, Network, and
Object-Oriented DBMS.
Hierarchical DBMS: As the name suggests,
this type of DBMS has a style of predecessor-
successor type of relationship. So, it has a
structure similar to that of a tree, wherein the
nodes represent records and the branches of the
tree represent fields.
Relational DBMS (RDBMS): This type of
DBMS, uses a structure that allows the users to
identify and access data in relation to another
piece of data in the database.
Network DBMS: This type of DBMS supports
many to many relations wherein multiple
member records can be linked.
Object-oriented DBMS: This type of DBMS
uses small individual software called objects.
Each object contains a piece of data, and the
instructions for the actions to be done with the
data.
READ Operation
Read Operation on any database means to fetch
some useful information from the database.
Once our database connection is established,
you are ready to make a query into this database.
You can use either fetchone() method to fetch
single record or fetchall() method to fetch
multiple values from a database table.
fetchone() − It fetches the next row of a
query result set. A result set is an object
that is returned when a cursor object is
used to query a table.
fetchall() − It fetches all the rows in a
result set. If some rows have already been
extracted from the result set, then it
retrieves the remaining rows from the
result set.
DATABASE CONNECTIVITY
Steps to connect MySQL database in Python
using MySQL Connector Python
Install MySQL Connector Python using
pip.
Use the mysql.connector.connect()method
of MySQL Connector Python with
required parameters to connect MySQL.
Use the connection object returned by a
connect()method to create a cursor object
to perform Database Operations.
The cursor.execute() to execute SQL
queries from Python.
Close the Cursor object using a
cursor.close() and MySQL database
connection using connection.close() after
your work completes.
Catch Exception if any that may occur
during this process.
OBJECTIVES
CRUD Operations
To maintain and manipulate the data, the system
will support CRUD (Create, Read, Update, Delete)
operations:
Report Generation
One of the critical functionalities of the system is
to generate reports that provide insights into
student performance. These reports will be
generated based on the data stored in the database
and can include:
Individual Student Report Cards: Displaying
detailed marks and grades across all exams for a
particular student.
Class Performance Reports: Summarizing the
performance of all students in a specific course or
exam.
Subject-wise Analysis: Offering insights into how
students are performing in different subjects,
which can be valuable for academic planning and
intervention.
TOOLS AND TECHNOLOGIES USED
SYSTEM REQUIREMENTS
SYSTEM DESIGN
Subjects Table
subject_id (Primary Key)
subject_name
Exams Table
exam_id (Primary Key)
exam_name
exam_date
Marks Table
mark_id (Primary Key)
student_id (Foreign Key)
subject_id (Foreign Key)
exam_id (Foreign Key)
marks
IMPLEMENTATION
Create Table
Insert data
Update data
Delete data
Retrieve data
OUTPUT SCREENSHOTS
Create Table
Insert data
Update data
Delete data
Retrieve data
DATABASE SETUP
PYTHON SOURCE CODE
import mysql.connector
cursor = connection.cursor()
query = "INSERT INTO students (name, subject,
marks) VALUES (%s, %s, %s)"
data = (name, subject, marks)
try:
cursor.execute(query, data)
connection.commit()
print("Student record added successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
cursor.close()
connection.close()
try:
cursor.execute(query)
records = cursor.fetchall()
if cursor.rowcount == 0:
print("No records found.")
else:
print("Student Records:")
for record in records:
print(f"ID: {record[0]}, Name: {record[1]},
Subject: {record[2]}, Marks: {record[3]}")
except mysql.connector.Error as err:
print(f"Error: {err}")
cursor.close()
connection.close()
cursor = connection.cursor()
query = "UPDATE students SET marks = %s WHERE
student_id = %s"
data = (new_marks, student_id)
try:
cursor.execute(query, data)
connection.commit()
if cursor.rowcount == 0:
print("No record found with the given ID.")
else:
print("Student marks updated successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
cursor.close()
connection.close()
cursor = connection.cursor()
query = "DELETE FROM students WHERE
student_id = %s"
data = (student_id,)
try:
cursor.execute(query, data)
connection.commit()
if cursor.rowcount == 0:
print("No record found with the given ID.")
else:
print("Student record deleted successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
cursor.close()
connection.close()
if choice == '1':
add_student()
elif choice == '2':
view_students()
elif choice == '3':
update_student_marks()
elif choice == '4':
delete_student()
elif choice == '5':
print("Exiting the program. Goodbye!")
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main_menu()