-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.py
More file actions
16 lines (13 loc) · 730 Bytes
/
sql.py
File metadata and controls
16 lines (13 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sqlite3
connection=sqlite3.connect("student.db")
cursor=connection.cursor()
cursor.execute("""create table Student(NAME varchar(20),CLASS varchar(20),SECTION varchar(10),MARK INT) """)
#insert values into table
cursor.execute(""" insert into student values("sathishsivam","Datascience","A",78)""")
cursor.execute(""" insert into student values("Mani","Datascience","A",98)""")
cursor.execute(""" insert into student values("Kumar","DevOps","B",68)""")
cursor.execute(""" insert into student values("Rajesh","Java","C",48)""")
cursor.execute(""" insert into student values("Ramesh","DevOps","B",98)""")
# res=cursor.execute(""" select * from student where class=='DevOps'""")
# for i in res:
# print(i)