Academic records using database connectivity in python program in 2021 |
Python Academic records using database connectivity in python program.
import sqlite3 as lit
a=input("Enter Student Id:")
a=int(a)
b=input("Enter Student Name:")
c=input("Enter Student Email:")
d=input("Enter Student Address:")
e=input("Enter Student RollNo:")
e=int(e)
f=input("Enter Student Course:")
g=input("Enter Student PhoneNo:")
g=int(g)
db=lit.connect('StudentDB.db')
with db:
h=db.cursor()
h.execute('insert into studen(Id,Name,Email,Address,RollNo,Course,PhoneNo)VALUES(?,?,?,?,?,?,?)',(a,b,c,d,e,f,g))
db.commit()
print("Data Inserted Sucessfuly")
db.close()
*****OUTPUT*****
Enter Student Id:746647
Enter Student Name:Icoderweb
Enter Student Email:icoderweb@gamil.com
Enter Student Address:Dehli
Enter Student RollNo:767357536
Enter Student Course:MCA
Enter Student PhoneNo:6467648364
Data Inserted Sucessfuly
import sqlite3 as lit
a=input("Enter Student Id:")
a=int(a)
b=input("Enter Student Name:")
c=input("Enter Student Email:")
d=input("Enter Student Address:")
e=input("Enter Student RollNo:")
e=int(e)
f=input("Enter Student Course:")
g=input("Enter Student PhoneNo:")
g=int(g)
db=lit.connect('StudentDB.db')
with db:
h=db.cursor()
h.execute('insert into studen(Id,Name,Email,Address,RollNo,Course,PhoneNo)VALUES(?,?,?,?,?,?,?)',(a,b,c,d,e,f,g))
db.commit()
print("Data Inserted Sucessfuly")
db.close()
*****OUTPUT*****
Enter Student Id:746647
Enter Student Name:Icoderweb
Enter Student Email:icoderweb@gamil.com
Enter Student Address:Dehli
Enter Student RollNo:767357536
Enter Student Course:MCA
Enter Student PhoneNo:6467648364
Data Inserted Sucessfuly
0 Comments