More Related Content
PDF
Python and MySQL Linking Class 12th Project File 23-24 PDF
Computer Project for class 12 CBSE on school management PDF
school-management-by-shivkamal-singh.pdf PDF
fee_managment_project_Code And Output documantation-1.pdf PPTX
PDF
dv-210220053508_removed.pdf PPTX
interface with mysql.pptx PPTX
21NOVXII-PYTHON-SQL & SAMPLEPAPER very.pptx Similar to Coding about python and MySQL connectivity
PPTX
C++ student management system PDF
DOCX
sample practical file 2022-23 aniket choudhary.docx PPTX
COMPasdeduikwhabihesjfguhseilzrslfejsrdfROG2.pptx PPTX
PPT
PPT
PDF
PDF
Library Management Python, MySQL PPTX
MySql Interface database in sql python my.pptx PDF
12th-computer-science-practical-study-material-english-medium.pdf PDF
12th-computer-science-practical-study-material-english-medium.pdf PPTX
DOCX
PDF
Sample for class 12 computer science_2024-25 PDF
Chapter Five - Relational Query Languages.pdf PDF
90 Informatics Practices.pdf DOCX
computer science file (python) PPTX
student record systemPresentation2 - Copy g1 new.pptx PPTX
SQL_Statement_Categories_With_Examples.pptx Recently uploaded
PPTX
WOWVerse Workshop: Agentic AI & LLM Workshop PPTX
820656155-Unit-III-Univariate-Analysis.pptx PPTX
Optimized access control techniques in Cloud Computing with Security and Scal... PPTX
AI-Agents-Concepts-Applications-and-Types.pptx PDF
Infinite Sequence and Series: It Includes basic Sequence and Series PPTX
Using Bangladesh studies in cse why matter ppp.pptx PPTX
Unit-2: Network Models--OSI Reference Model, TCP/IP Reference Model PPTX
We-Optimized-Everything-Except-Decision-Quality-Maintenance-MaintWiz.pptx PDF
JVM in the Age of AI: 2026 Edition - Deep Dive PPTX
Distresses in Road Flexible pavement.pptx PDF
Introduction to C++.pdf it is best material for beginner student and above that PPTX
The #1 Reason Your MRO Budget Exploded — And How Predictive Maintenance Fixes It PDF
TechRush Hackathon 2026: A Platform for Innovation, Learning, and Real-World ... PDF
0.39 Inch Micro-OLED Display 1024×768 XGA Panel Silicon OLED PPTX
'LECTURE 7 - TYPES OF CONTRACTS_103902'.pptx PDF
ERTMS-conference-WS8_Presentations_v0.pdf PPTX
35501622005_Sujay Samanta_Seminar22-26.pptx PPTX
Speech to Text with Tone Correction.pptx PDF
Brillouin zone analysis using Kronig-Penny model PPTX
Basic Volume Mass Relationship and unit weight as function of volumetric wate... Coding about python and MySQL connectivity
- 1.
PRINT(“CLASS : “,I[1])
PRINT(“ROLL NO. : “,I[2])
PRINT (“ADDRESS : “,I[3])
PRINT(“PHONE NO. : “,I[4])
PRINT (“”)
PRINT (“”)
DEF ADDT():
TID=INT(INPUT(“TEACHER ID : “))
N=INPUT (“NAME : “)
S=INT(INPUT(“SALARY : “))
A=INPUT(“ADDRESS : “)
PH= INT(INPUT(“PHONE NO. : “))
DATA= (TID,N,S,A,PH)
SQL=‘INSERT INTO TEACHER VALUES (%S,%S,%S,%S,%S)’
C=CON.CURSOR()
C.EXECUTE(SQL,DATA)
CON.COMMIT()
PRINT(“DATA ENTERED SUCCESSFULLY”)
PRINT (“”)
DEF REMOVET():
- 2.
• #Main Program
•
•import mysql.connector as a
•
• con=a.connect(host=‘localhost’,user=‘root’,passwd=‘root’,
•
• database =‘school’)
•
• def addst ():
•
• n=input(“Student name : “)
•
• cl=input (“Class : “)
•
• r=int(input(“Roll no. : “))
•
• a=input(“Address : “)
•
• ph= int(input(“Phone no. : “))
•
• data= (n,cl,r,a,ph)
•
• sql=‘insert into student values (%s,%s,%s,%s,%s)’
•
• c=con.cursor()
•
• c.execute(sql,data)
•
• con.commit()
•
• print(“data entered successfully”)
- 3.
• Print (“”)
•
•def removest():
•
• cl=input (“class : “)
•
• r=input(“roll no. : “)
•
• data=(cl,r)
•
• sql=‘delete from student where class=%s and roll=%s’
•
• c=con.cursor()
•
• c.execute(sql,data)
•
• con.commit()
•
• print(“data deleted successfully”)
•
• print (“”)
•
• def displayst():
•
• cl=input(“class : “)
•
• data=(cl,)
•
• sql=‘select * from student where class=%s’
•
• c=con.cursor()
•
• c.execute(sql,data)
•
• d=c.fetchall()
•
• for I in d :
•
• print (“Name : “, i[0])
- 4.
PRINT (“”)
DEF REMOVEST():
CL=INPUT(“CLASS : “)
R=INPUT(“ROLL NO. : “)
DATA=(CL,R)
SQL=‘DELETE FROM STUDENT WHERE CLASS=%S AND ROLL=%S’
C=CON.CURSOR()
C.EXECUTE(SQL,DATA)
CON.COMMIT()
PRINT(“DATA DELETED SUCCESSFULLY”)
PRINT (“”)
DEF DISPLAYST():
CL=INPUT(“CLASS : “)
DATA=(CL,)
SQL=‘SELECT * FROM STUDENT WHERE CLASS=%S’
C=CON.CURSOR()
C.EXECUTE(SQL,DATA)
D=C.FETCHALL()
FOR I IN D :
PRINT (“NAME : “, I[0])