-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFinalStudent.py
51 lines (46 loc) · 1.23 KB
/
FinalStudent.py
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
import sqlite3
## Remove error if primary key is same
from sqlite3 import IntegrityError
## Remove error if table already exists
from sqlite3 import OperationalError
conn = sqlite3.connect('Student.db')
c = conn.cursor()
from InsertData import *
from DisplayAllData import *
from DisplayRow import *
from OrderTable import *
from DeleteRow import *
from Update import *
from DropAndCreateTable import *
z=0
while(True):
print "1. CREATE TABLE"
print "2. INSERT DATA"
print "3. DISPLAY TABLE"
print "4. DISPLAY ROW"
print "5. ORDER TABLE"
print "6. UPDATE TABLE"
print "7. DELETE SOME ENTRY"
print "8. DROP TABLE"
print "9. EXIT"
z=raw_input("Select an option:")
if(z=='1'):
createtable()
elif(z=='2'):
insertdata()
elif(z=='3'):
display_all_data()
elif(z=='4'):
displayrow()
elif(z=='5'):
ordertable()
elif(z=='8'):
droptable()
elif(z=='7'):
deleterow()
elif(z=='6'):
update()
elif (z=='9'):
break
else:
print 'You entered a wrong value \nTry again'