This repository contains various Python scripts for connecting to and performing operations on a MySQL database. Below is a description of each script along with its functionality.
This script connects to a MySQL database, retrieves data from the employees
table, and prints the data in a formatted table using the tabulate
library.
This script demonstrates various database operations such as:
- Retrieving data from the
employees
table. - Inserting new records into the
employees
table. - Deleting records from the
employees
table. - Updating existing records in the
employees
table.
It also includes the ability to list all databases on the MySQL server.
This script retrieves data from the employees
table and exports it to an Excel file. It also demonstrates how to send an email with the exported file as an attachment using the smtplib
library.
This script connects to a MySQL database, retrieves data from the employees
table, and saves it to an Excel file using the pandas
library.
This script demonstrates how to connect to a MySQL database using SQLAlchemy, define a table schema, and create the table in the database.