Ip Class 12 Project Python and SQL
Ip Class 12 Project Python and SQL
Management
System
Done by:
Zahabiya and
Anjana
Of class 12 B
1
INDEX
SNO. CONTENTS PAGE
NO.
1. Acknowledgement 3
2. Introduction 4
3. Database Design 5
4. Source code 6
5. Output Design 12
6. Conclusion 20
7. Bibliography 21
2
Acknowledgement
We would like to express our sincere gratitude to the our school
and their officials for providing us with the resources and the
opportunity to undertake this Information Practices project.
Their continuous support and encouragement have been
invaluable throughout the project.
We would also like to extend our heartfelt thanks to Ms.
Swapna Ma'am, our subject teacher, for her guidance, patience,
and insightful feedback. Her expertise and constant motivation
helped us stay on track and improve the quality of our work.
Without her support, this project would not have been as
successful as it is.
Lastly, we would like to express our deepest appreciation to our
parents for their unwavering support and encouragement. Their
belief in us and their constant understanding made it possible for
us to complete this project with dedication and enthusiasm.
3
Introduction
Student Data Management using
Python and MySQL
4
Database Design
Csv Python and Mysql
CSV Table:
MYSQL Table:
5
SOURCE CODE
import pandas as pd
import matplotlib.pyplot as plt
import mysql.connector as sc
def read_csv_file():
df=pd.read_csv("C:\\Users\\OASISLAB\\Downloads\\adm.csv)
print(df)
def data_analysis_menu(): df=pd.read_csv("C:\\Users\\
OASISLAB\\Downloads\\adm.csv")
while True:
print('_'*98)
print('1. Show Columns')
print('2. Show Specific Column')
print('3. how Top Rows')
print('4. Row Bottom Rows')
print('5. Add a New Column')
print('6. Delete a Column')
print('7. Data Summery')
print('8. Exit (Move to main menu)')
ch = int(input('\n\nEnter your choice:')
if ch == 1:
print(df.columns)
wait = input('\n\n\n Press any key to continuee.....')
if ch == 2:
print(df.columns)
col_name = input('Enter Column Name that You want to
print : ')
print(df[col_name])
wait = input('\n\n\n Press any key to continuee.....')
if ch == 3:
6
n = int(input('Enter Total rows you want to show :'))
print(df.head(n))
wait = input('\n\n\n Press any key to continuee.....')
if ch == 4:
n = int(input('Enter Total rows you want to show :'))
print(df.tail(n))
wait = input('\n\n\n Press any key to continuee.....)
if ch == 5:
col_name = input('Enter new column name :')
col_value = int(input('Enter default column value :'))
df[col_name] = col_value
print(df)
print('\n\n\n Press any key to continue....')
wait = input()
if ch == 6:
col_name = input('Enter column Name to delete :')
del df[col_name]
print(df)
print('\n\n\n Press any key to continue....')
wait = input()
if ch == 7:
print(df.describe())
print("\n\n\nPress any key to continue....")
wait = input()
if ch == 8:
break
def graph():
df = pd.read_csv("C:\\Users\\OASISLAB\\Downloads\\
adm.csv")
while True:
print('\nGRAPH MENU ')
print('_'*100)
print('1. Marks Line Graph\n')
print('2. Marks Bar Graph\n')
7
print('3. Marks Horizontal Bar graph\n')
print('4. Exit (Move to main menu)')
ch = int(input('Enter your choice:'))
if ch == 1:
x = df['Name']
y = df['Marks']
plt.xlabel('Name of the Students')
plt.ylabel('Marks')
plt.title('Marks of Students')
plt.grid(True)
plt.plot(x,y)
plt.show()
if ch == 2:
x = df['Name']
y = df['Marks']
plt.xlabel('Name of the Students')
plt.ylabel('Marks')
plt.title('Marks of Students')
plt.bar(x, y)
plt.grid(True)
plt.show()
if ch == 3:
x = df['Name']
y = df['Marks']
plt.xlabel('Name of the Students')
plt.ylabel('Marks')
plt.title('Marks of Students')
plt.barh(x,y)
plt.show()
if ch == 4:
break
def export_menu():
df = pd.read_csv('C:\\Users\\OASISLAB\\Downloads\\adm.csv')
8
while True:
print('\n\nEXPORT MENU ')
print('_'*100)
print()
print('1. CSV File\n')
print('2. Excel File\n')
print('3. Exit (Move to main menu)\n')
ch = int(input('Enter your Choice : '))
if ch == 1:
df.to_csv('C:\\Users\\OASISLAB\\Downloads\\adm2.csv')
print('\n\nCheck your new file "adm2.csv" on C: Drive.....')
wait = input('\n\n\n Press any key to continuee.....')
if ch == 2:
df.to_excel('C:\\Users\\OASISLAB\\Downloads\\
adm2.xlsx')
print('\n\nCheck your new file "adm2.xlsx" on C: Drive.....')
wait = input('\n\n\n Press any key to continuee.....')
if ch == 3:
break
def Marks_Display_SQL():
while True:
print('\n\nMarks Display from Database ')
print('_'*100)
print()
print('1. Add Details\n')
print('2. Search Details\n')
print('3. Remove Details\n')
print('4. Exit (Move to main menu)\n')
ch = int(input('Enter your Choice : '))
if ch == 1:
admno=int(input("Enter Admission No:"))
Name=input("Enter Student Name :")
HY=int(input("Enter Halfyearly marks:"))
FY=int(input("Enter Final year marks:"))
9
Grade=input("Enter Grade:")
conn=sc.connect(host="localhost",user="root",password="tiger",d
atabase="Results")
mycursor=conn.cursor()
query1="insert into Marks values({},'{}',{},
{},'{}')".format(admno,Name,HY,FY,Grade)
mycursor.execute(query1)
conn.commit()
conn.close()
wait = input('\n\n\n Press any key to continuee.....')
if ch == 2:
sname=input("Enter the Name of the Student you want to
search:")
print("\n")
conn=sc.connect(host="localhost",user="root",password="tiger",d
atabase="Results")
mycursor=conn.cursor()
query1="select * from Marks where
Name='{}'".format(sname)
mycursor.execute(query1)
myrecord=mycursor.fetchall()
for x in myrecord:
print(x)
conn.close()
wait = input('\n\n\n Press any key to continuee.....')
if ch == 3:
admno=int(input("Enter the Admission number of the
Student you want to remove:"))
conn=sc.connect(host="localhost",user="root",password="tiger",d
atabase="Results")
mycursor=conn.cursor()
query1="delete from Marks where
admno='{}'".format(admno)
mycursor.execute(query1)
10
conn.commit()
conn.close()
wait = input('\n\n\n Press any key to continuee.....')
if ch == 4:
break
while True:
print('MAIN MENU ')
print('_'*100)
print()
print('1. Show Whole Dataframe\n')
print('2. Data Analysis Menu\n')
print('3. Graph Menu\n')
print('4. Export Data\n')
print('5. Marks Display from Database\n')
print('6. Exit\n')
ch = int(input('Enter your choice :'))
if ch == 1:
read_csv_file()
wait = input('\n\n Press any key to continue....')
if ch == 2:
data_analysis_menu()
wait = input('\n\n Press any key to continue....')
if ch == 3:
graph()
wait = input('\n\n Press any key to continue....')
if ch == 4:
export_menu()
wait = input('\n\n Press any key to continue....')
if ch == 5:
Marks_Display_SQL()
wait = input('\n\n Press any key to continue....')
if ch == 6:
break
11
Output design
MAIN MENU
3. Graph Menu
4. Export Data
6. Exit
1. Show Columns
12
5. Add a New Column
6. Delete a Column
7. Data Summery
13
14
Enter your choice :3
GRAPH MENU
15
*Enter your choice:3
16
Enter your choice :4
EXPORT MENU
1. CSV File
2. Excel File
17
Enter your choice :5
1. Add Details
2. Search Details
3. Remove Details
18
*Enter your Choice : 2
19
CONCLUSION
20
BIBLIOGRAPHY
- Learn Python
[https://www.geeksforgeeks.org/python-os-link-method/]
-Holoviz
https://panel.holoviz.org/how_to/links/links.html
21