This is a personal data analysis project using MySQL and Python. The goal of the project is to practice and strengthen my skills in data analysis, working with databases, and Python programming.
To set up this project locally, follow these steps:
git clone https://github.com/your-username/word-data.git
pip install -r requirements.txt
Ensure you have Python 3.10.13 or higher installed.
Install Jupyter notebook
pip install notebook
To run this project, you need to configure the following environment variables. Create a .env
file in the root directory of the project and add the variables below:
DB_DIALECT=mysql
DB_USERNAME=your_username
DB_PASSWORD=your_password
DB_HOST=localhost
DB_DATABASE=your_database
Make sure to replace the placeholders with your actual database credentials.
Once the dependencies are installed and the environment variables are set up, launch Jupyter Notebook with the following command:
jupyter notebook
This will open Jupyter Notebook in your browser. Open the notebook file and run the cell to initiate the data analysis process using the configuration from your .env
file.
To visualize the population data on a map, click the image below to view the map:
The SQL files used to populate the database can be found in the /sql
directory. These queries include all the necessary operations to set up the database.
For example:
-- sql/create_table_country.sql
CREATE TABLE country (
id INT PRIMARY KEY,
name VARCHAR(255),
population INT
);
The SQL scripts are provided for setting up the database structure and importing the data.
This project is licensed under the Proprietary License. You may not use, distribute, or modify this project without my explicit permission. Please contact me if you wish to inquire about usage rights.
Answer: You need to create a MySQL database and configure the connection in the .env
file as described in the Environment Variables section.
Answer: This project requires Python 3.10.13 or later.
Answer: Follow the installation instructions provided in the Installation section to install the necessary dependencies using pip.
Answer: The SQL queries are located in the /sql
directory. You can run these queries directly in your MySQL database using a MySQL client or command line interface. Make sure to adjust the database connection settings in the .env
file before running the queries.
Answer: Ensure that your .env
file contains the correct database credentials. If you encounter connection issues, check your MySQL server’s status and ensure that it is running. Additionally, make sure that firewall settings are not blocking the connection to the database.
Answer: Currently, this project is configured to work with MySQL. However, you can modify the database connection settings in the code to work with other relational databases such as PostgreSQL or SQLite.