CREATE TABLES.py
import mysql.connector as mq
md=mq.connect(host="localhost",user="root",passwd="hacker",database="sidd")
if md.is_connected():
print("connection established")
mcur=md.cursor()
mcur.execute("create table reg(sno numeric(10),name varchar(30),reg_no numeric(10))")
md.commit()
for i in mcur:
print(i)
md.close()
Comments
Post a Comment