Banner.video.2024-05-19.07_30_06.mp4
This project involves analyzing sales data using SQL. The goal is to perform various queries to gain insights into the sales performance of a company. The analysis includes retrieving data, calculating totals and averages, identifying top-performing regions and products, and more.
- Dataset: The provided sample dataset contains sales data with the following columns:
- Date: Date of the sale
- Product: Name of the product sold
- Sales: Total sales revenue generated
- Profit: Profit earned from the sale
- Region: Region where the sale occurred
- Provide explanations and interpretations of the results obtained from each query.
- Organize the analysis in a clear and structured manner.
- Use SQL functions and clauses to enhance the analysis.
- Take a screenshot of the code and the results in the solution document.
- MySQL
Performing the following tasks using SQL queries
- Retrieve all columns from the 'sales' table.
- Find the total sales and total profit generated.
- Calculate the average sales and average profit.
- Identify the top 3 regions with the highest total sales.
- Determine the product with the highest profit margin.
- Find the total sales and profit for each product.
- Calculate the average profit for each region.
- Identify the date with the highest sales.
- Determine the product with the highest sales in the East region.
- Identify the top 5 dates with the highest sales.
I provided my solutions in two documents. A google doc and google sheet.
On the google doc, I wrote the MySQL queries with the explanations. see a snap shot of it below.
To access the google doc click here
On the google sheet, I have all the images of the query results from MySQL. See below

To access the google sheet file click here
To access the entire MySQL code, click here.
- Here is a youtube tutorial on how to install MySQL workbench
- Download and install MySQL Workbench from the official MySQL website: MySQL Workbench
- Open MySQL Workbench.
- In the Navigator pane on the left side, locate and expand the "SCHEMAS" section.
- Right-click on the empty space within the "SCHEMAS" section and select "Create Schema...".
- Enter "company_sales" as the name for the schema and click "Apply".
- Download the provided dataset or use the table named "sales".
- In MySQL Workbench, right-click on the "company_sales" schema that you just created.
- Select "Table Data Import Wizard".
- Follow the wizard to import the table named "sales" into the "company_sales" schema.
- Make sure to specify the correct file or database connection for importing the table.
- Open the MySQL script file containing the code you want to run.
- Make sure the schema is set to "company_sales" at the top of the script, or specify it explicitly in the queries.
- Highlight the queries you want to execute.
- Click the lightning bolt icon or use the shortcut (Ctrl+Enter) to run the selected queries.
- Review the results in the output panel to verify the execution of the queries.
- Ensure that MySQL Workbench is properly configured and connected to your MySQL server instance.
- Double-check the schema name and table name to ensure they match the names used in the MySQL code.
- Modify the queries as needed to suit your specific analysis