0% found this document useful (0 votes)
51 views9 pages

CS Project by Baigan - XII C - 10

Yowaimo

Uploaded by

gintokisakatafr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
51 views9 pages

CS Project by Baigan - XII C - 10

Yowaimo

Uploaded by

gintokisakatafr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
Python Coding eeveesereree=**L ala Lajpat Rai Bal Mandir Sr Sec School ***+####eer#ee4eeeee4" eseeereeeneeeses*¢T DENT INFORMATION SYSTEM *##8#+4itertsesetemerenneenee #*******Designed and Maintained By:" #*******M UDASIR ANSARI - CLASS XII C - ROLL NO - 10 [2023-2024 ]" import mysql.connector # GLOBAL VARIABLES DECLARATION myConnnection = #MODULE TO CHECK MYSQL CONNECTIVITY def MYSQLconnectionCheck (): global myConnection global userName global password userName = input("\n ENTER MYSQL SERVER'S USERNAME password = input("\n ENTER MYSQL SERVER'S PASSWORD : ") myConnection=mysql.connector.connect(host="Iocalhost’ user=userName,passwd =password , auth_plugin='mysql_native_password! ) if myConnection: print("\n CONGRATULATIONS ! YOUR MYSQL CONNECTION HAS BEEN ESTABLISHED !") cursor=myConnection.cursor() cursorexecute("CREATE DATABASE IF NOT EXISTS SMS") cursorexecute("COMMIT") cursorclose() return myConne else: print("\nERROR ESTABLISHING MYSQL CONNECTION CHECK USERNAME AND PASSWORD !") #MODULE TO ESTABLISHED MYSQL CONNECTION def MYSQLconnection (): global userName global password global myConnection myConnection=mysql.connectorconnect{host="localhost’,user=userName,passwd =password , database="SMS" , auth_plugin='mysql_native_password' ) if myConnection: return myConnection else: print("\nERROR ESTABLISHING MYSQL CONNECTION !") myConnection.close() #MODULE FOR NEW ADMISSION def newStudent( if myConnecti cursor=myConnection.cursor() createTable ‘CREATE TABLE IF NOT EXISTS — STUDENT(SNAME VARCHAR(30), FNAME VARCHAR(30),MNAME VARCHAR(30) ,PHONE —VARCHAR(12), ADDRESS —_- VARCHAR(100),SCLASS VARCHAR(S),SSECTION VARCHAR(5), SROLL_NO VARCHAR(5),SADMISSION_NO VARCHAR(10) PRIMARY KEY) cursorexecute(createTable) sname=input("\n ENTER STUDENT'S NAME :") fname=input(” ENTER FATHER'S NAME : ") ENTER MOTHER'S NAME : ") phone=input(" jput((" ENTER ADDRESS : input(" ENTER CLASS : ") ENTER SECTION li ENTER ROLL_NO : sadmission_no=input(” ENTER ADMISSION_NO : ") put(’ ER CONTACT sql="INSERT INTO student(SNAME,FNAME,MNAME,PHONE,ADDRESS,SCLASS,SSECTIONSROLL_ NO,SADMISSION_NO) VALUES(%s,%s,%5,%5,%5,%3,65,%5,%S) values=(sname,fname,mname,phone,address .sclass,ssection,sroll_no,sadmission_no) cursorexecute(sqlvalues) cursorexecute("COMMIT") cursor.close() print("\nNew Student Enrolled Successfully !") 10 else: print("\nERROR ESTABLISHING MYSQL CONNECTION !") #MODULE TO DISPLAY STUDENT'S DATA def displayStudent(): cursor=myConnection.cursor() if myConnection: cursorexecute("SELECT * FROM STUDENT") data=cursorfetchall() print(data) cursorclose() else: print(""\nSomthing Went Wrong Please Try Agai #MODULE TO UPDATE STUDENT'S RECORD def updateStudent() put("ENTER ADMISSION NO”) ‘SELECT * FROM STUDENT WHERE SADMISSION_NO= %s" cursorexecute(sql,(admission_no,)) rsorfetchall() ‘PRESS 1 FOR NAME") 'PRESS 2 FOR CLASS") ‘PRESS 3 FOR ROLL NO") it{input("Enter Your Choice")) if choice==1: name=input("ENTER NAME OF THE STUDENT") sql="UPDATE STUDENT SET SNAME= %s WHERE SADMISSION_NO = %s" cursorexecute(sql,(name,admission_no)) cursorexecute("COMMIT") print("NAME UPDATED") elif choice == 2: std=input("ENTER CLASS OF THE STUDENT :") sql="UPDATE STUDENT SET SCLASS= %s WHERE SADMISSION_NO= %s" cursorexecute(sql,(std,admission_no)) cursorexecute("COMMIT") print(“CLASS UPDATED") elif choice==3: roll no=int(input("ENTER ROLL NO OF THE STUDENT :")) ul sql="UPDATE STUDENT SET —_SROLL_NO= %s WHERE SADMISSION_NO = %s" cursorexecute(sq],(roll_no,admission_no)) cursorexecute("COMMIT") print("ROLL NO UPDATED") else: print("Record Not Found Try Again !") cursorclose() else: print("\nSomthing Went Wrong ,Please Try Again !") #MODULE TO ENTER MARKS OF THE STUDENT def marksStudent () : if myConnection cursor=myConnection.cursor() createTable ="""CREATE TABLE IF NOT EXISTS MARKS(SADMISSION_NO VARCHAR(10) PRIMARY KEY,HINDI INTENGLISH INT MATH INT, SCIENCE INT;SOCIAL INT,COMPUTER INT,TOTAL INT AVERAGE DECIMAL) cursorexecute(createTable) admission_no=input("ENTER ADMISSION NO OF THE STUDENT :") hindi=int(input("\n ENTER MARKS OF HINDI : ")) english=int(input("\n ENTER MARKS OF ENGLISH :")) math=int(input("\n ENTER MARKS OF MATH science=int(input(”\n ENTER MARKS OF SCIENCE : ")) social=int(input("\n ENTER MARKS OF SOCIAL : ")) computer =int(input("\n ENTER MARKS OF COMPUTER : ")) total = hindi + english + math + science + social + computer average = total/6 sql="INSERT INTO MARKS(SADMISSION_NO,HINDIENGLISH,MATH,SCIENCE,SOCIAL,COMPUTER, ‘TOTAL, AVERAGE) VALUES(%s,68,%s,%s,%5,%S,%S,%s,%S)" values=(admission_no,hindi,english,math,science,social,computer , total , average) cursorexecute(sqlvalues) cursorexecute("COMMIT") cursorclose() print("\nMarks of the Student Entered Successfully !") else: print("\nERROR ESTABLISHING MYSQL CONNECTION !") #MODULE TO GENERATE REPORT CARD OF ALL STUDENTS 12 def reportCardAllStudent () : cursor=myConnection.cursor() if myConnection: cursor.execute("SELECT * FROM MARKS") data=cursorfetchall() print(data) cursorclose() else: print("\nSomthing Went Wrong ,Please Try Again !") #QMODULE TO GENERATE REPORT CARD OF ONE STUDENTS def reportCardOneStudent() cursor=myConnection.cursor() i myConnection: admission_no=input(ENTER ADMISSION NO OF THE STUDENT :") cursor=myConnection.cursor() sql="SELECT * FROM MARKS WHERE SADMISSION_NO= %s" cursorexecute(sql,(admission_no,)) data=cursorfetchall() ifdata: print(data) else: print("Record Not Found , Please Try Again !") cursorcclose() else: print("\nSomthing Went Wrong ,Please Try Again !") #MODULE TO ENTER FEES OF THE STUDENTS: def feeStudent () if myConnection: cursor=myConnection.cursor() createTable ="""CREATE TABLE IF NOT EXISTS FEES(SADMISSION_NO VARCHAR(10) PRIMARY KEYMONTH INT ,TUTION.FEES = INTVVN INT ,COMPUTER FEES INT, MUSIC_FEES INT, TOTAL INT) cursorexecute(createTable) admission_no=input("ENTER ADMISSION NO OF THE STUDENT :") mont! ENTER MONTH IN NUMERIC FORM (1-12) :")) tutionfee=int(input("\n ENTER TUTION FEES : ")) put("\n ENTER VVN : ")) computerfee=int(input("\n ENTER COMPUTER FEES : ")) musicfee=int(input("\n ENTER MUSIC FEES: ")) total = tutionfee + vvn + computerfee + musicfee t(input("\n 13 sql="INSERT INTO FEES(SADMISSION_NO,MONTH,TUTION_FEES,VVN,COMPUTER_FEES,MUSIC_FEES,TOTAL) VALUES(%s,5,968,%s,%5,%S,%S)" values=(admission_no,month,tutionfee,vvn,computerfee,musicfee,total) cursorexecute(sql,values] cursorexecute("COMMIT") cursorclose() print("\nFees of Student Accepted Successfully !") else: print("\nERROR ESTABLISHING MYSQL CONNECTION !") #MODULE TO GENERATE FEES RECEIPT OF ALL STUDENTS def feeReceiptallstudent(): cursor=myConnection.cursor() if myConnection: cursor.execute("SELECT * FROM FEES") data=cursorfetchall() print(data) cursorcloseQ) else: print("\nSomthing Went Wrong ,Please Try Again !") #MODULE TO GENERATE, def feeReceiptOneStudent() cursor=myConnection.cursor() if myConnection: admission_no=input("ENTER ADMISSION NO OF THE STUDENT :") cursor=myConnection.cursor() sql="SELECT * FROM FEES WHERE SADMISSION_NO= %s" cursorexecute(sql,(admission_no,)) data=cursorfetchall() if data: print(data) else: print("Record Not Found , Please Try Again !") cursorclose() 'S RECEIPT OF ONE STUDENT else: print("\nSomthing Went Wrong ,Please Try Again !") #MODULE TO ISSUE TRANSFER CERTIFICATE def transferStudent( cursor=myConnection.cursor() 4 if myConnecti admission_no=input("ENTER ADMISSION NO OF THE STUDENT :") cursor=myConnection.cursor() sql="SELECT * FROM STUDENT WHERE SADMISSION_NO= %s" cursorexecute(sql,(admission_no,)) data=cursorfetchall() if data: sql=("DELETE FROM STUDENT WHERE SADMISSION_NO=%s") cursorexecute(sql,(admission_no,)) cursorexecute("COMMIT") print("Student's Transfer Certificate Generated !!!") else: print("Record Not Found , Please Try Again !") cursorclose() else: print("\nSomthing Went Wrong, Please Try Again !") #MODULE TO PROVIDE HELP FOR USER def helpMe(): print("Please, Visit The Offeial Website Of Lala Lajpat Rai School To Download The Mannual uw) # MAIN SCREEN OF THE SYSTEM print ("#4 944 4 AEE EE HH") print("\n| SESSION 2023 - 2024. " t("\n] WELCOME. n print("\n] Lala Lajpat Rai Bal Mandir Sr Sec School Ranchi n print("\n[*****#*###*#48+#6=*STUDENT INFORMATION SYSTEM*#####+#h00s+ene4ee4s08/") print("\n[********##*###8##*DESIGNED AND MAINTAINED BY:*#*#######8«=#«)) print("\n|************MUDASIR ANSARI - CLASS XII C - ROLL NO - 10 ********|") print("\n| print("\n] ‘STUDENT INFORMATION SYSTEM print("\n] Dra ("sf 4# 44949844848 PP eee) #STARTING POINT OF THE SYSTEM 15 myConnection = MYSQLconnectionCheck () if myConnection: MYSQLconnection () while(1): pein; we eeee eee eee eee eee se memmemmeeemete |) print(y) Enter 1- New Admission. 9 print("| Enter 2- Display Student's Data. ‘ print("| Enter 3 - Update Students's Data a) print("| Enter 4 Issue Transfer Certificate 1") print(’| Enter 5 - Add Student's Marks Detail. " print("| Enter 6 - Generate All Student's Report Card. |") print("| Enter 7 - Generate Student Wise Report Card. |") print("| Enter 8 - Pay Student's Fee. ) print("| Enter 9 - Generate Student Wise Fees Receipt. |") print("| Enter 10 - Generate Student's Fee Receipt. '") print("| Enter 11- Exit. ") print("| print("| Enter 0(ZERO) - Help. print("| choice=int(input(”PLEASE ENTER YOUR CHOICE : ")) if choice==1: newStudent() elif choice==2: displayStudent() elif choice==3: updateStudent() elif choice==4: transferStudent() elif choic marksStudent() elif choice==6: reportCardAllstudent() elif choice==7: reportCardOneStudent() elif choice==8: feeStudent() elif choice==9: feeReceiptAllstudent() elif choice==10: feeReceiptOneStudent() elif choice==11: myConnection.close() break elif choice==0: 16 helpMe() else: print("Sorry May Be You Are Giving Me Wrong Input, Please Try Again !!!") else: print("Check Your MYSQL Connection First !") # END OF THE PROJECT 7

You might also like