-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.py
27 lines (25 loc) · 859 Bytes
/
delete.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
import mysql.connector
conn=mysql.connector.connect(
host='localhost',
database='ums',
user='root',
password='deepthi@2000'
)
cur=conn.cursor()
class delete:
def deptdelete(x,id):
cur.execute(f"delete from department where departmentid={id}")
conn.commit()
print("Data has been deleted successfully")
def coursedelete(x,id):
cur.execute(f"delete from course where courseid={id}")
conn.commit()
print("Data has been deleted successfully.")
def facultydelete(x,id):
cur.execute(f"Delete from faculty where facultyid={id}")
conn.commit()
print("Data has been deleted successfully.")
def studentdelete(x,id):
cur.execute(f"delete from student where studentid={id}")
conn.commit()
print("Data has been deleted successfully.")