You are on page 1of 19

SESSION 2023-3024

PROJECT FILE
OF
COMPUTER SCIENCE
ON

School fees and management


UNDER GUIDANCE OF
MRS.POONAM PAWAR
SUBMITTED BY
swy
ROLL NO. – 41
CLASS - XII-B

ST. ANGEL’S SCHOOL


SECTOR 15, A BLOCK
ROHINI, NEW DELHI-110085
Index
S.No. Topic T.Sign.

1 Certificate

2 Acknowledgement

3 Introduction

4 Programs Used

5 Source Code

6 Output

7 Bibliography
Certificate
This is to herby Certify that the genuine and
original work has been done to code and
execute the program. This is the genuine work
of preparation of School fees and management
and the program is original in all aspects.

Collection of facts for the project and coding of


the database program has been completed
solely, sincerely, and satisfactorily by " YASH
RANA ” of class " XII-B " of " St. Angel’s Sr. Sec.
School , Sector 15 , Rohini" regarding the project.

…………………….

Teacher’s signature
Acknowledgement

It would be my utmost pleasure to express my


gratitude and sincere thanks to my Computer
Science teacher “Mrs.Poonam Pawar” Ma’am for
involving me in such an informative project and
providing a helping hand in this project.

My Sincere thanks to my parents for their help and


support.

I must thank my classmates for their timely


support for the completion of this project.
Python
Introduction-
It is widely used general purpose, high level
programming language. It is developed by Guido van
Rossum in 1991.

It is used for-
Software development, web development (server-side),
system scripting, Mathematics.

Features of Python-
❖ Easy to use: Due to simple syntax rule.
❖ Interpreted language: Code execution &
interpretation line by line.
❖ Cross-platform language: It can run on windows,
Linux, Macintosh, etc. equally.
❖ Expressive language: Less code to be written as it
itself express the purpose of the code.
❖ Completeness: Support wide range of library.
❖ Free & Open Source: Can be downloaded freely and
source code can be modifying for improvement.
Shortcomings of Python-
❖ Lesser libraries : as compared to other
programming languages like c++ , java,.net
❖ Slow language: as it is interpreted languages, it
executes the program slowly.
❖ Weak on Type-binding: It not pin point on use of a
single variable for different data type.
About MySQL
Introduction:
MySQL is currently the most popular open source database
software. It is a multi-user, multithreaded database management
system. MySQL is especially popular on the web. It is one of the
parts of the very popular LAMP platform. Linux, Apache, MySQL and
PHP or WIMP platform Windows, Apache, MySQL and PHP. MySQL
AB was founded by Michael Widenius (Monty), David Axmark and
Allan Larsson in Sweden in year 1995.

Features of MySQL:
❖ Open Source & Free of Cost: It is Open Source and available at
free of cost.
❖ Portability: Small enough in size to install and run it on any
types of Hardware and OS like Linux,MS Windows or Mac etc.
❖ Security: Its Databases are secured & protected with password.
❖ Connectivity: Various APIs are developed to connect it with
many programming languages.
❖ Query Language: It supports SQL (Structured Query Language)
for handling database.
Programs Used

• Python 3.8.3 [IDLE]

• MySQL
CODING

SQL Commands to create both the tables:


Student table:

mysql> CREATE TABLE student (roll int(5) Primary key, name


varchar(20) NOT NULL, age int(2) NOT

NULL, class varchar(3), City varchar(10));

Fee table:

mysql> CREATE TABLE fee (roll int(5) references Student(roll),


FeeDeposit int(6) NOT NULL, month
varchar(10));

Python Code:

import os

import platform

import mysql.connector

import pandas as pd

mydb=mysql.connector.connect(host="localhost",\

user="root",\

passwd="root",\

database="School")

mycursor=mydb.cursor()

def stuInsert():

L=[]

roll=int(input("Enter the roll number : "))

L.append(roll)

name=input("Enter the Name: ")

L.append(name)

age=int(input("Enter Age of Student : "))

L.append(age)

classs=input("Enter the Class : ")


L.append(classs)

city=input("Enter the City ofthe Student : ")

L.append(city)

stud=(L)

sql="insert into student (roll,name,age,class,city) values


(%s,%s,%s,%s,%s)"

mycursor.execute(sql,stud)

mydb.commit()

def stuView():

print("Select the search criteria : ")

print("1. Roll")

print("2. Name")

print("3. Age")

print("4. City")

print("5. All")

ch=int(input("Enter the choice : "))

if ch==1:

s=int(input("Enter roll no : "))

rl=(s,)

sql="select * from student where roll=%s"


mycursor.execute(sql,rl)

elif ch==2:

s=input("Enter Name : ")

rl=(s,)

sql="select * from student where name=%s"

mycursor.execute(sql,rl)

elif ch==3:

s=int(input("Enter age : "))

rl=(s,)

sql="select * from student where age=%s"

mycursor.execute(sql,rl)

elif ch==4:

s=input("Enter City : ")

rl=(s,)

sql="select * from student where City=%s"

mycursor.execute(sql,rl)

elif ch==5:

sql="select * from student"

mycursor.execute(sql)

res=mycursor.fetchall()
print("The Students details are as follows : ")

print("(ROll, Name, Age, Class, City)")

for x in res:

print(x)

def feeDeposit():

L=[]

roll=int(input("Enter the roll number : "))

L.append(roll)

feedeposit=int(input("Enter the Fee to be deposited : "))

L.append(feedeposit)

month=input("Enter month of fee : ")

L.append(month)

fee=(L)

sql="insert into fee (roll,feeDeposit,Month) values (%s,%s,%s)"

mycursor.execute(sql,fee)

mydb.commit()

def feeView():

print("Please enter the details to view the fee details :")


roll=int(input("Enter the roll number of the student whose fee is to be
viewed : "))

sql="Select Student.Roll, Student.Name, Student.Class,


sum(fee.feeDeposit), fee.month from Student

INNER JOIN fee ON Student.roll=fee.roll and fee.roll = %s"

rl=(roll,)

mycursor.execute(sql,rl)

res=mycursor.fetchall()

for x in res:

print(x)

def removeStu():

roll=int(input("Enter the roll number of the student to be deleted : "))

rl=(roll,)

sql="Delete from fee where roll=%s"

mycursor.execute(sql,rl)

sql="Delete from Student where roll=%s"

mycursor.execute(sql,rl)

mydb.commit()
def MenuSet(): #Function For The Student Management System

print("Enter 1 : To Add Student")

print("Enter 2 : To View Student ")

print("Enter 3 : To Deposit Fee ")

print("Enter 4 : To Remove Student")

print("Enter 5 : To View Fee of Any Student")

try: #Using Exceptions For Validation

userInput = int(input("Please Select An Above Option: ")) #Will Take


Input From User

except ValueError:

exit("\nHy! That's Not A Number") #Error Message

else:

print("\n") #Print New Line

if(userInput == 1):

stuInsert()

elif (userInput==2):

stuView()

elif (userInput==3):
feeDeposit()

elif (userInput==4):

removeStu()

elif (userInput==5):

feeView()

else:

print("Enter correct choice. . . ")

MenuSet()

def runAgain():

runAgn = input("\nwant To Run Again Y/n: ")

while(runAgn.lower() == 'y'):

if(platform.system() == "Windows"):

print(os.system('cls'))

else:

print(os.system('clear'))

MenuSet()

runAgn = input("\nwant To Run Again Y/n: ")

runAgain()
Bibliography
• Computer science with Python Class XI
& XII by Preeti Arora.
• Internet.

You might also like