forked from Aaris-Kazi/Data-Visualization-Using-Matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_database.py
More file actions
25 lines (20 loc) · 870 Bytes
/
test_database.py
File metadata and controls
25 lines (20 loc) · 870 Bytes
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
import mysql.connector
def td():
conn = mysql.connector.connect(host='localhost', user='root', password='', database='python_database')
cursor = conn.cursor()
cursor.execute('select Name from test where Subject ="AVG TH + PR" && Attendance < 75')
print('\t\tDefaulter:\n')
for i in cursor:
print(i)
def td1():
conn = mysql.connector.connect(host='localhost', user='root', password='', database='python_database')
cursor = conn.cursor()
cursor.execute('select Name from test where Subject ="AVG TH + PR" && Attendance < 75')
rows = cursor.fetchall()
return rows
def td2():
conn = mysql.connector.connect(host='localhost', user='root', password='', database='python_database')
cursor = conn.cursor()
cursor.execute('select * from test')
rows = cursor.fetchall()
return rows