SQL Cleanup

Ensuring Tables Are Empty Before Running SQL Solution
import mysql.connector
from mysql.connector import Error
from nbdev.showdoc import *
try:
    connection = mysql.connector.connect(user='root', host='localhost')
    cursor = connection.cursor()
    cursor.execute("""
    USE exam_db;
    DROP TABLE temp_contact_methods;
    DROP TABLE temp_contacts;
    DROP TABLE temp_gifts;
    DROP TABLE contact_methods;
    DROP TABLE contacts;
    DROP TABLE gifts;
    """)
except Error as e:
    print(f"Error: {e}")
finally:
    if connection.is_connected():
        cursor.close()
        connection.close()