Program to delete record from Database using the id entered by the user.
Solution:
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 the 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', deleted record.
Python program to delete a Record from the Database
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer