0% found this document useful (0 votes)
9 views

Sample Project File-1

Sample project cs

Uploaded by

luckykmbabrala
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)
9 views

Sample Project File-1

Sample project cs

Uploaded by

luckykmbabrala
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
You are on page 1/ 19

[submitted as a part of AISSCE 2019-20]

PREPARED BY SUBMITTED TO
S.No. Particulars Page No.

1 Certificate 1

2 Acknowledgement 2

3 About Python 3

4 Description of Project 4

5 Source Code 5-12

6 Outputs 13-17
This is to certify that Miss KHUSHI SHARMA and Miss SNEHA YADAV
of class XII Commerce have successfully completed this Informatics
Practices Project titled

'STUDENT INFORMATION SYSTEM'

as a part of the fulfillment for the requirement of 'All India Senior


Secondary Certificate Examination 2019-20 under my guidance and
supervision.

__________________ __________________
Internal Examiner External Examiner
Surendra Singh
DAV Fertilizer Public School
Babrala

____________________
Principal's Signature

Page-1
The submission of this project work provides us with a great opportunity to
look back and thank all those who have been directly and indirectly
associated in completion of this project work. Mr. Surendra Singh, our
Informatics Practices teacher particularly as a great source of inspiration
for us.

We express our sincere gratitude to our adorable and respectable


Informatics Practices teacher Mr. Surendra Singh. We are lucky to get an
opportunity to work under his valuable guidance and suggestions in
completing the project successfully.

We are also very much thankful to our Principal Sir, Mr. Anand Swaroop
Saraswat for providing us conducive environment and moral support to
complete the project wok.

Page-2
Python 3.7.0 is the newest major release of the Python language, and it
contains many new features and optimizations. Among the major new
features in Python 3.7 are: PEP 539, new C API for thread-local storage
PEP 545, Python documentation translations.

Python is an interpreted, high-level, general-purpose programming


language. Created by Guido van Rossum and first released in 1991,
Python's design philosophy emphasizes code readability with its notable
use of significant whitespace. Its language constructs and object-oriented
approach aim to help programmers write clear, logical code for small and
large-scale projects.[27]
Python is dynamically typed and garbage-collected. It supports multiple
programming paradigms, including procedural, object-oriented, and
functional programming. Python is often described as a "batteries included"
language due to its comprehensive standard library.[28]
Python was conceived in the late 1980s as a successor to the ABC language.
Python 2.0, released in 2000, introduced features like list comprehensions
and a garbage collection system capable of collecting reference cycles.
Python 3.0, released in 2008, was a major revision of the language that is
not completely backward-compatible, and much Python 2 code does not run
unmodified on Python 3.
The Python 2 language, i.e. Python 2.7.x, is "sunsetting" in less than a
month on January 1, 2020 (after extension; first planned for 2015), and the
Python team of volunteers will not fix security issues, or improve it in other
ways after that date.[29][30] With the end-of-life, only Python 3.5.x and
later will be supported.
Python interpreters are available for many operating systems.

Page-3
A student information system is a software application for managing
details and records of the students.

Considering the need of the present scenario, this project has been made to
facilitate the registration on computer system for fast accessing of the
records as and when required. This project has been designed to meet the
following requirements………

 Create table student


 Registration of student
 Display records of all registered students
 Search a student
 Search a student category wise
 Search a student class wise
 Search a student section wise
 Search a student house wise
 Update a student’s information
 Delete a record of student

Page-4
#------------------------------------------------------------------------------------------------------------------
# Python-MySQL Connection
#------------------------------------------------------------------------------------------------------------------
import mysql.connector
mydb=mysql.connector.connect(host="localhost",\
user="root",\
passwd="tcdav",\
database="school")
mycursor=mydb.cursor()

#------------------------------------------------------------------------------------------------------------------
# Create Table Student FUNCTION
#------------------------------------------------------------------------------------------------------------------
def CreateTable():
try:
mycursor.execute("CREATE TABLE Student \
(AdmnNo INT AUTO_INCREMENT PRIMARY KEY,\
sname VARCHAR(20),\
contact VARCHAR(12),\
house VARCHAR(12),\
class int(10),\
section VARCHAR(12),\
mothername VARCHAR(20),\
fathername VARCHAR(20),\
gender VARCHAR(10),\
category VARCHAR(10),\
address VARCHAR(50),\
cityname VARCHAR(20),\
statename VARCHAR(20),\
bloodgrp VARCHAR(2),\
DOB DATE )")
print("Wow! Table created successfully")
except:
print("Table already created.")
print("Enjoy your project!!!")

print()
r=input("Press any key to continue.....")

Page-5
#------------------------------------------------------------------------------------------------------------------
# Register Student FUNCTION
#------------------------------------------------------------------------------------------------------------------
def Register():
print("----------------Data Entry----------------")
choice='y'
while(choice=='y' or choice=='Y'):
sname=input("Enter student's name? ")
cno=int(input("Enter contact number? "))
house=input("Enter student's house? ")
clas=int(input("Enter student's class? "))
section=input("Enter student's section? ")
mname=input("Enter student's mother name? ")
fname=input("Enter student's father name ? ")
gender=input("Enter student's gender? ")
cate=input("Enter student's category? ")
add=input("Enter student's address? ")
ctname=input("Enter student's city name? ")
statename=input("Enter student's state name? ")
bloodgrp=input("Enter blood group of student?")
dob=input("Enter student' date of birth?")
mycursor = mydb.cursor()
sql="INSERT INTO
Student(sname,contact,house,class,section,mothername,fathername,gender,category,a
ddress,cityname,statename,bloodgrp,
DOB)\
VALUES (%s, %s, %s, %s, %s, %s, %s,%s, %s, %s, %s, %s, %s, %s)"
val =
(sname,cno,house,clas,section,mname,fname,gender,cate,add,ctname,statename,blood
grp,dob)
mycursor.execute(sql, val)

"""mydb.commit()required to make the changes,


otherwise no changes are made to the table."""

mydb.commit()
print(mycursor.rowcount, "Registration done successfully.")
print()
choice=input("Enter Y or y for more registration? ")

Page-6
#------------------------------------------------------------------------------------------------------------------
# Show All Registration FUNCTION
#------------------------------------------------------------------------------------------------------------------
def ShowAll():
sql="select * from Student"
mycursor.execute(sql)
print()
print()
print("All Registrations")
print()
for row in mycursor:
print(row)
mydb.close()
print()
print(mycursor.rowcount, "records found.")
print()
r=input("Press any key to continue.....")

#------------------------------------------------------------------------------------------------------------------
# SEARCH STUDENT FUNCTION
#------------------------------------------------------------------------------------------------------------------
def SearchStudent():
rn=int(input("Enter Student Admission number? "))
sql = "SELECT * FROM Student WHERE AdmnNo=%s"
mycursor.execute(sql, (rn,))
myresult = mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("Failed to get record from MySQL table")
mydb.close()
r=input("Press any key to continue.....")

Page-7
#------------------------------------------------------------------------------------------------------------------
# Search Student Category Wise
#------------------------------------------------------------------------------------------------------------------
def Categorywise():
rn=input("Enter Student category? ")
sql = "SELECT * FROM Student WHERE category=%s"
mycursor.execute(sql, (rn,))
myresult = mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("Failed to get record from MySQL table")
mydb.close()
r=input("Press any key to continue.....")

#------------------------------------------------------------------------------------------------------------------
# Search Student Class Wise
#------------------------------------------------------------------------------------------------------------------
def Classwise():
rn=input("Enter student's class?")
sql="Select * from Student WHERE class=%s"
mycursor.execute(sql,(rn,))
myresult = mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("OOPS!Failed to get record from MYSQL table")
mydb.close()
r=input("Press any key to continue....")

Page-8
#------------------------------------------------------------------------------------------------------------------
# Search Student Section Wise
#------------------------------------------------------------------------------------------------------------------
def Sectionwise():
rn=input("Enter student's section?")
sql="Select * from Student WHERE section=%s"
mycursor.execute(sql,(rn,))
myresult= mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("OOPS!Failed to get record...")
mydb.close()
r=input("Press any key to continue....")

#------------------------------------------------------------------------------------------------------------------
# Search Student Housewise
#------------------------------------------------------------------------------------------------------------------

def housewise():
hou=input("Enter student's house?")
sql="Select * from Student WHERE house=%s"
mycursor.execute(sql,(hou,))
myresult= mycursor.fetchall()
if myresult != "":
for x in myresult:
print(x)
else:
print("OOPS!Failed to get record...")
mydb.close()
r=input("Press any key to continue....")

Page-9
#------------------------------------------------------------------------------------------------------------------
# Update Information FUNCTION
#------------------------------------------------------------------------------------------------------------------

def UpdateInformation():
adm=int(input("Enter Admission number to update entry? "))
phno=int(input("Enter contact number? "))
add=input("Enter current address? ")
str="UPDATE Student SET contact=%s,address=%s where AdmnNo=%s"
val=(phno, add, adm)
mycursor.execute(str, val)
mydb.commit()
print()
print(mycursor.rowcount, "record updated successfully.")
print()
r=input("Press any key to continue.....")

#------------------------------------------------------------------------------------------------------------------
# Delete Record FUNCTION
#------------------------------------------------------------------------------------------------------------------

def DeleteStudent():
adm=input("Enter admission number to delete record? ")
mycursor = mydb.cursor()
sql = "DELETE FROM STUDENT WHERE AdmnNo = %s"
val=(adm,)
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount, "record(s) deleted")
print()
r=input("Press any key to continue.....")

Page-10
#------------------------------------------------------------------------------------------------------------------
# Program Menu Code
#------------------------------------------------------------------------------------------------------------------
while True:
print("--------------------------------------------------------------------------------------------------")
print("********WELCOME TO STUDENT INFORMATION SYSTEM*******")
print("--------------------------------------------------------------------------------------------------")
print(" 1: Create Student Table ")
print(" 2: Register a Student ")
print(" 3: Show All Registered Students ")
print(" 4: Search a Student ")
print(" 5: Search a student category wise ")
print(" 6: Search a student class wise ")
print(" 7: Search a student section wise ")
print(" 8: Search a student house wise ")
print(" 9: Update Student Information ")
print(" 10: Delete a Student Record ")
print(" 11: Exit ")
print("--------------------------------------------------------------------------------------------------")
print()
choice = int(input(" Please enter your choice: "))
if choice == 1 :
CreateTable()
elif choice == 2:
Register()
elif choice == 3:
ShowAll()
elif choice == 4:
SearchStudent()
elif choice == 5:
Categorywise()
elif choice == 6:
Classwise()
elif choice == 7:
Sectionwise()
elif choice== 8:
housewise()
elif choice == 9:
UpdateInformation()
elif choice == 10:
DeleteStudent()
elif choice ==11:
quit()
else:
print("You must only select either 1 to 7")
print("Please try again")
Page-11
Table Creation

Page-12
Register Student

Page-13
All Registrations

Search Student

Page-14
Search Student Category Wise

Search Student Class Wise

Page-15
Search Student Section Wise

Search Student House Wise

Page-16
Update Function

Delete function

Page-17

You might also like