Computer Science Project

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

INDEX

 Certificate of Excellence
 Acknowledgement
 Introduction
 Objectives of the project
 System Requirements
a) Hardware Requirements
b) Software Requirements
 Theoretical Background
a) Python
b) Database
c) MySQL
d) Python-MySQL Connectivity
 Source Code of this Project
 Output
 Appendix
 Future Enhancement of Project
 Bibliography
INTRODUCTION

In the landscape of competitive exams, coaching institutes play a


pivotal role in guiding and preparing students for success. The Joint
Entrance Examination (JEE) is a crucial milestone for engineering
aspirants, and the registration process becomes the initial step in their
academic journey. Recognizing the significance of streamlined
administrative processes for coaching institutes, our investigatory
project focuses on the development of a sophisticated JEE Mains
Registration Information System tailored for these institutions.

The traditional approach to student registration in coaching institutes


often involves manual paperwork, leading to inefficiencies, data
discrepancies, and administrative challenges. In response to these
issues, our project aims to harness the power of Computer Science to
create an efficient and secure system for storing and managing student
details during the JEE Mains registration process.
Objectives of the project
The objectives of the JEE Mains Registration Information System
project for coaching institutes encompass a range of goals aimed at
improving efficiency, data management, and overall user experience.
Here are the key objectives:

1. Automation of Registration Process :


 Develop an automated system to streamline the JEE Mains
registration process for students enrolled in coaching
institutes.
 Reduce manual data entry, minimizing the likelihood of
errors and ensuring a faster and more efficient registration
experience.

2. Efficient Data Management :


 Design a comprehensive database management system to
store, organize, and manage student details effectively.
 Enable quick retrieval, modification, and secure storage of
student information for coaching institute administrators.

3. User-Friendly Interface for Institutes :


 Create an intuitive and user-friendly interface tailored for
coaching institute administrators.
 Provide real-time insights into the registration status,
allowing administrators to monitor progress and address any
issues promptly.
4. Enhanced Data Accuracy and Security:
 Implement robust data validation mechanisms to ensure the
accuracy and integrity of student information.
 Incorporate stringent security measures to protect sensitive
student data, maintaining confidentiality and compliance
with privacy regulations.

5. Scalability and Adaptability:


 Design the system with scalability in mind, ensuring it can
handle an increasing number of student registrations without
compromising performance.
 Build an adaptable architecture capable of accommodating
changes in examination protocols and future updates in
technology or educational requirements.
System Requirements

Hardware Requirements:
A computer with a modern processor and sufficient RAM is
suitable for running Python and a MySQL database. Adequate
storage space for the MySQL database and the Python program
files.

Software Requirements:
 Windows 11 as Operating System
 Python 3.7.7 as Front-end Developing software
 MySQL as Back-end Software
 MySQL.Connector for connecting both ends
 MS Word or Google Docs for Documentation
Theoretical Background
1. Python-Simplified Programming Language:

Python is powerful object-oriented programming language


which was developed by Guido Van Rossum in February
1991. It is flexible and easy to learn. It is portable language
and freely available. To download Python, we can visit the
webpage http://www.python.org/ and download the desired
version from Downloads tab.
Some Advantages of Python:

❖ Dynamic typing is allowed

❖ Syntax is easy

❖ Coding is easy to understand and less expensive

❖ More modules and libraries can be imported and used for


program developing.
1. Tkinter module for creating GUI applications
2. Matplotlib library for creating 2D plots easily
3. Urllib module for accessing websites within your
program
4. NumPy for advance math functionalities
In Python, We can run our coding in two modes:
i. Interactive mode
ii. Script mode
Interactive mode gives output for each and every line, i.e
Output is sandwiched in between the coding Script mode
allows coding to be in program format.

INTERACTIVE MODE:
Script Mode:

2. Database :

Data is something which has no meaning. When it is


processed, it becomes information.
We need data for some purposes such as applying forms
and conducting surveys. Data is used in economics,
Statistics, Science and Research.
To access and manipulate data easier, we need some
structure which is known as Database.
Let us see features of good database.
Features of Good Database:

 Centralised approach: Can be accessed from


anywhere and anytime.
 It must allow accurate data to be entered.
 It must not allow data to be redundant and
inconsistent.
 It must be secure one so that it can be accessed only
by he authorized users.

So, in order to have good databases we can use Database


Management System (DBMS) to maintain and access
databases.
One of type’s database is Relational Database where
database is organised into tables.

General Properties of Relational Database:

 In any given column of a table, all items are of same


kind whereas items in different columns may not be
of same kind.
 For a row, each column must have am atomic value
and also for a row, a column cannot have more than
one value.
 All rows of a relation are distinct.
 Order of row is immaterial.
 Columns must have unique names and order of
columns is also immaterial

On other hand, we also have non-relational databases to


store big data E.g. Graph Databases, Key-Value
Databases.
Here, we use relational database for data to be consistent
and accurate.

ILLUSTRATION OF RELATIONAL DATABASE:


SOME BASIC TERMS USED IN RELATIONAL
DATABASE:
Row: Horizontal subset of a relation
Column: Vertical subset of a relation
Domain: Pool of values from which values of table is
drawn
Relation: Group of logical related rows Degree :
Number of columns in a relation
Cardinality: Number of rows in a relation
View: Virtual table whose values are taken from one or
more underlying table(s)
Primary Key: Set of one or more attributes which can
uniquely identify the tuple or row in a relation.
Candidate Key: Attribute combinations inside a relation
that can serve as primary Key
Foreign Key: A non-key attribute whose values are
derived from primary key of some other table

MySQL:

MySQL is a Relational DBMS which uses Structured


Query Language (SQL). It is downloadable from
www.mysql.org and is free of cost.
Features Of MySQL :
 Speed: MySQL runs very fast, if the server
hardware is optimal.
 Ease of use: MySQL is relatively simple and high-
performance database system.
 Open Source and Free of cost
 Supports Structured Query Language Portable
Language
 Supports Different types of data by providing many
data types
 Secured One
 Scalability and Limits: MySQL can handle large
databases. Some real-life MySQL databases contain
50 million records and 60,000 tables.
 Connectivity: We can connect to MySQL server
using several protocols.
 Localization: The server can provide error messages
in many languages.
 Works on Client-Server Mode
MYSQL LOGO:

MYSQL COMMAND LINE CLIENT:


SQL Commands:

SQL is data sublanguage which just interacts with


databases. It provides different types of commands which
are classified into following categories:
 Data Definition Language (DDL): Creates and
alters schema objects, grants and revokes privileges
and maintains table.

 Data Manipulation Language (DML):


Manipulates and displays data ❖Transaction
Control Commands

 Session Control Commands

 System Control Commands

SOME IMPORTANT SQL COMMANDS :


DDL:
 CREATE TABLE
Syntax:
CREATE TABLE <table name> (<column name>
<datatype(size)> <constraint>, <column name>
<datatype(size)> <constraint>,…);
 ALTER TABLE
Syntax:
ALTER TABLE <table name> ADD/MODIFY
(<column name><datatype(size)<constraint>);

 DROP TABLE
Syntax:
DROP TABLE [IF EXISTS] <table name>

These commands are used in creating and altering table


and columns.

DML:

 SELECT COMMAND
Syntax:
SELECT (<column name list>)/* FROM <table
name> [WHERE <condition>];

 INSERT INTO COMMAND


Syntax:
INSERT INTO <table name> VALUES(<values>);

 DELETE FROM COMMAND


Syntax:
DELETE FROM <table name> VALUES (<value
list>);

 UPDATE COMMAND
Syntax:
UPDATE<table name> SET<column name>=<value>
[WHERE<condition>];

These commands are used in MYSQL for creating and


accessing data items.

3. PYTHON-MYSQL CONNECTIVITY:

We can connect Python with MySQL server to create


and handle databases by importing MySQL.Connector
module.
So, let us learn how we connect Python with MySQL and
execute query through it.

1. Importing the module


import MySQL.Connector as my

2. Connecting using connect()


<con_obj> = my.connect (host=<host> ,user=<user>
,passwd=<password> ,database =<database>)

3. Creating cursor object


cur = con.cursor()

4. Executing the query


cur.execute(<query>)

5. Retrieving the result set (in case of select or show


command)
c = cur.fetchall() or

c = cur.fetchone() or
c = cur.fetchmany(<no>) and/or
c = cur.rowcount

6. Cleaning up the environment


<con_ob>.close()
CODING

File 1 (Registration of table) :

import mysql.connector as sql


conn=sql.connect(host='localhost',user='root',passwd='lo
kesh',database='JEE')
if conn.is_connected():
print('connected sucessfully')
c1=conn.cursor()
c1.execute(""" create table registration_information
(name varchar(30),dob varchar(30),fg_na
varchar(40),mg_na varchar(40),gen varchar(10),
nati varchar(30),iden varchar(30),inum varchar(40),cat
varchar(30),resi varchar(10),
pwd varchar(10),ai int,ea varchar(10),session
varchar(10),medium varchar(30),premisesno
varchar(10),locality varchar(30),subl varchar(40),dis
varchar(30),state varchar(30),
country varchar(30),pin int(10),contact
varchar(20),contact1 varchar(20),email varchar(40),
regis_no int primary key)""")
File 2 (Login table) :

import mysql.connector as sql


conn=sql.connect(host='localhost',user='root',passwd='lo
kesh',database='JEE')
if conn.is_connected():
print('connected sucessfully')
c1=conn.cursor()
c_sql=("""create table if not exists login_info
(user varchar(10) primary key, pass varchar(10)) """)
c1.execute(c_sql)
user=input("User : ")
password=input("Password : ")
try:
c_sq=("insert into login_info
values('"+user+"','"+password+"')")
c1.execute(c_sq)
except:
print("User name already exists")
conn.commit()
File 3 (Main File) :

import mysql.connector as sql

conn = sql.connect(host='localhost', user='root',


passwd='lokesh', database='JEE')

#conn refers to connection object to connect python with


database(mysql)

if conn.is_connected():
print('Connected successfully')

c1 = conn.cursor() #c1 refers to cursor object


c1.execute("select * from login_info")
dat = c1.fetchall() #dat refers data in a table

user = input("Enter user name: ")


passwd = input("Enter the password: ") #passwd-
password
if (user, passwd) in dat:
print("""============================
==============================
JEE MAINS REGISTRATION
========================================
================== """)
print("1: ADD DETAILS")
print("2: VIEW DETAILS")
print("3: QUIT")
ch=0
while ch!=3:
ch = int(input("Enter the choice: "))
if ch == 1:
c1.execute("select * from
registration_information")
c_data = c1.fetchall()
c_count = len(c_data)

c_reg_no = c_count + 1
c_name = input("Enter Your Name: ")
#c_ refres to candidate
c_dob = input("Enter Your Date of Birth: ")
c_fg_na = input("Enter Your Father/Guardian
Name: ")
c_mg_na = input("Enter Your Mother/Guardian
Name: ")
c_gen = input("Enter Your Gender: ")
c_nati = input("Enter Your Nationality: ")
c_iden = input("Identity proof with photo
(Aadhar/Pancard/Bank passbook/Passport/Ration
Card/Election Card): ")
c_inum = input("Enter Identification Number: ")
c_cat = input("Enter Category (General/Gen-
EWS/OBC-NCL/SC/ST): ")
c_resi = input("Enter Place of Residence
(Urban/Rural): ")
c_pwd = input("Are you a Pwd Candidate?
(yes/no): ")
c_ai = int(input("Enter Annual Income: "))
c_ea = input("Exam Applied for
(B.E/B.Tech/B.Arch): ")
c_session = input("Session Applied for (1st/1st &
2nd): ")
c_medium = input("Exam Paper Medium
(English/Hindi/Others): ")
c_premisesno = input("House (Premises
No/Name): ")
c_locality = input("Enter Your Locality: ")
c_subl = input("Enter Your Sub Locality: ")
c_dis = input("Enter Your District: ")
c_state = input("Enter Your State: ")
c_country = input("Enter Your Country: ")
c_pin = int(input("Enter Pin code: "))
c_contact = input("Enter Your Contact No: ")
c_contact1 = input("Enter Another Contact No: ")
c_email = input("Enter Your Email: ")

c_sql=""" insert into registration_information


(name,dob,fg_na,mg_na,gen,nati,iden,inum,cat,resi,pwd,
ai,ea,session,medium,premisesno,locality,subl,dis,state,c
ountry,pin,contact,contact1,email,regis_no)

values('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}',{},'{}',
'{}','{}','{}',

'{}','{}','{}','{}','{}',{},'{}','{}','{}',{})""".format(c_name,
c_dob,c_fg_na,c_mg_na,c_gen,c_nati,c_iden,c_inum,c_c
at,c_resi,c_pwd,c_ai,c_ea,c_session,c_medium,c_premis
esno,c_locality,c_subl,c_dis,c_state,c_country,c_pin,c_c
ontact,c_contact1,c_email,c_reg_no)
print("Registered Successfully Your Registration
Number is: ", c_reg_no)
c1.execute(c_sql)
conn.commit()

elif ch == 2:

reg = int(input("Enter the registration number: "))


c_ch = f"SELECT * FROM
registration_information WHERE regis_no = {reg}"
c1.execute(c_ch)
data = c1.fetchone()
print('\n')
print("Registration No : ", data[25])
print("Name : ", data[0])
print("Date of Birth : ", data[1])
print("Father's/Guardian Name : ", data[2])
print("Mother's/Guardian Name : ", data[3])
print("Gender : ", data[4])
print("Nationality : ", data[5])
print("Identity Proof : ", data[6])
print("Identity Number : ", data[7])
print("Category : ", data[8])
print("Residency : ", data[9])
print("PWD : ", data[10])
print("Annual Income : ", data[11])
print("Exam Applied : ", data[12])
print("Session Applied : ", data[13])
print("Medium of Paper : ", data[14])
print("Premises No : ", data[15])
print("Locality : ", data[16])
print("Sub Locality : ", data[17])
print("District : ", data[18])
print("State : ", data[19])
print("Country : ", data[20])
print("Pin Code : ", data[21])
print("Contact Number : ", data[22])
print("Contact Number1 : ",data[23])
print("Email Id : ",data[24])
print('')
elif ch == 3:
print("""=============================
=========================
QUITTING!!!
Thanks For Visiting
========================================
============== """)

else:
print("INVALID CHOICE PLEASE TRY
AGAIN")

else:
print('Connection failed')
OUTPUT

Creating a Database:

Tables Created in Database:


Output for Registration of table file:

Output for Login table file:


Description of registration information
table:
Description of login info table:

Output for Main file 1:


Output for Adding Details in file :

Output for Viewing Details in file :


Output for Quitting :
Appendix
Module: mysql.connector

Package for database programming


Functions Working
connect() establishes connection
between MySQL and Python
cursor() facilitates the row by row
processing of records in the
resultset
is_connected() check whether connection is
established or not
execute() for the execution of sql query
commit() to save the changes that you
have you made
fetchone() only fetch one record
fetchall() fetches all records
fetchmany() fetches as many records as
you want
rowcount() returns the number of rows
retrieved from the
cursor

format() to insert the records


Future Enhancement of Project

 Feature Expansion: Add new features and


functionalities based on user feedback and evolving
requirements. This could involve improving existing
features or introducing entirely new ones to enhance
the user experience.

 Integration with Third-Party Tools: Enhance


interoperability by integrating the project with other
popular tools, platforms, or services. This can provide
users with a more seamless experience and increase
the project's utility.

 Performance Optimization: Continuously work on


optimizing the project's performance to ensure faster
response times, better scalability, and improved
resource efficiency.

 User Interface (UI) and User Experience (UX)


Enhancements: Regularly update and refine the user
interface to make it more intuitive, visually appealing,
and user-friendly. This can involve incorporating
modern design principles and improving navigation.
 Security Improvements: Implement enhanced
security measures to protect against potential
vulnerabilities. This may include regular security
audits, updates, and the integration of the latest
security technologies.

 Mobile Optimization: If applicable, optimize the


project for mobile devices to accommodate users who
access the project on smartphones and tablets. This
can involve developing dedicated mobile apps or
ensuring a responsive design for web-based
applications.

 Machine Learning and Artificial Intelligence


Integration: Explore opportunities to incorporate
machine learning or artificial intelligence to improve
automation, recommendation systems, or predictive
capabilities within the project.

 Localization and Globalization: Expand the project's


reach by supporting multiple languages and
accommodating cultural differences. This can involve
translating content, adapting features, and ensuring
compatibility with diverse international standards.

 Accessibility Improvements: Ensure that the project


is accessible to users with disabilities by incorporating
accessibility features and complying with relevant
standards (e.g., WCAG).
 Community Engagement: Foster a community
around the project by implementing forums, user
groups, or other channels for users to share their
experiences, request features, and collaborate on the
project's development.

 Offline Functionality: If applicable, consider adding


offline functionality to the project, allowing users to
access certain features or content even when they are
not connected to the internet.

 Scalability: Ensure that the project can handle


increased usage and data as it grows. This may involve
optimizing databases, adopting scalable infrastructure,
and implementing load balancing.

 Advanced Analytics and Reporting: Integrate


advanced analytics tools to provide users with more
sophisticated insights and reporting capabilities. This
could involve the use of data visualization techniques
and customizable reporting dashboards.

 Blockchain Integration: Explore opportunities to


leverage blockchain technology for enhanced security,
transparency, and trust in certain aspects of the project,
especially in industries where it is relevant.
Bibliography

Computer Science with python


-by Sumita Arora
 www.python.org/download
 www.py2exe.org
 www.mysql.org
 Various other reference materials and
websites for enhancement of coding.

You might also like