We will use Python's PyMySql library to work with the database. This library provides the programmer the functionality to run MySQL query using Python.
Algorithm:
- Step 1: Connect to database using connect() method in pymysql.
- Step 2: Get input of faculty ID from the user.
- Step 3: Write a query to fetch the details of the faculty and display it to the user.
- Step 4: Get confirmation input from the user.
- Step 5: If 'Yes', delete the record and print "Record Deleted".
Program to delete a record from database using its ID
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer