-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert1.py
More file actions
58 lines (48 loc) · 1.57 KB
/
Copy pathinsert1.py
File metadata and controls
58 lines (48 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import sqlite3
conn =sqlite3.connect("Attendance.db")
cursor = conn.cursor()
print("Connection established Successfully .... ")
def insert_complete(name,roll,year,div):
cursor.execute("""
select CID from CLASS where Year=? and Div=?;
""",(year,div,))
data=cursor.fetchall()
# print(data[0][0])
cid=int(data[0][0])
cursor.execute("""
insert into student (NAME,Roll,CID) VALUES (?,?,?);
""",(name,roll,cid,))
cursor.execute("""
select SID from Student where Roll=? and CID=?;
""",(roll,cid,))
data=cursor.fetchall()
sid=int(data[0][0])
p=int(0)
if year=="SE":
cursor.execute("""
insert into SE (CID,SID,OOP,DSA,DELD,DM,COA) VALUES (?,?,?,?,?,?,?);
""",(cid,sid,p,p,p,p,p,))
elif year=="TE":
cursor.execute("""
insert into TE (CID,SID,CN,DBMS,TOC,ISEE,SEPM) VALUES (?,?,?,?,?,?,?);
""",(cid,sid,p,p,p,p,p,))
elif year=="BE":
cursor.execute("""
insert into BE (CID,SID,AI,E1,E2,Comp,DA) VALUES (?,?,?,?,?,?,?);
""",(cid,sid,p,p,p,p,p,))
conn.commit()
conn.close()
def subjects():
year = input("Enter Year : ").upper()
cursor.execute("""
select subject from lec_count where year = ?
""",(year,))
sub = cursor.fetchall()
print(type(sub))
def insert_menue():
name=input("Enter Your Name ").upper()
roll=int(input("Enter Your Roll no. "))
year=input("Enter Your Year of Study ")
div=input("Enter Your Division ")
insert_complete()
pass