You are on page 1of 3

ADITYA BIRLA PUBLIC SCHOOL, RAYAGADA

PRACTICAL FILE/PRACTICAL RECORD


CLASS-XII

ACADEMIC SESSION 2023-24

SUBJECT-COMPUTER SCIENCE (083)

Page 1 of 3
Index Page:
Srno Name Of Page No Performed Teacher’s
Experiments/Program Date Signature
1 Write a Program to Perform 1 24th July
Insert Command Using 2023
Python & MYSQL (Data
Base Connectivity)

OBJECTIVE:
Write a Program to Perform Insert Command Using Python & MYSQL
(Data Base Connectivity)

SYSTEM CONFIGURATION
Software:
Operating System Windows 10 or later version
Python Editor Python 3.11
Or Python Anaconda Jupyter
Notebook 6.1.4
MYSQL Editor Version 5.1.33
MYSQL-Connector
DOS Version 10.0.22621.1992
System Type 64-bit operating system, x64-
based processor
Hardware:
Processor Intel Processor i3 or i5
Intel(R) Core(TM) i3-10110U
CPU @ 2.10GHz 2.59 GHz
RAM 8GB
SSD 256 GB
HDD 1TB
Storage Google Drive

Page 2 of 3
SOURCE CODE:
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd="jvms",da
tabase="school")
mycursor=mydb.cursor()
sql="insert into emp(EMPID,NAME,AGE,CITY)values(%s,%s,%s,%s)"
val=(4,'mohit',25,'rayagada')
mycursor.execute(sql,val)
mydb.commit()
print(mycursor.rowcount("record Inserted Successfully"))

OUTPUT:

Page 3 of 3

You might also like