This repository documents the process of analyzing avocado sales data using SQL queries. Below is a step-by-step explanation of how the data was processed and used:
-
CSV to SQL Conversion:
- The website Convert CSV to SQL was used to convert the
avocado_c.csvfile into an SQL-compatible format (avocado_c.sql).
- The website Convert CSV to SQL was used to convert the
-
Table Creation:
- The converted SQL file (
avocado_c.sql) was used to create theavocado_table.sql, which defines the structure of theavocado_salestable.
- The converted SQL file (
-
Query Analysis:
- The
avocado_salestable was populated and queried using theavocado_analysis.sqlfile, containing multiple SQL queries for analysis.
- The
- How many total avocados were sold across all records?
- What is the average price of avocados in the dataset?
- Which 5 cities sold the most avocados?
- Which type of avocado (conventional or organic) was sold the most?
- How many small, large, and x-large bags were sold?
- What is the highest price recorded for avocados, and in which city and on what date did it occur?
- What is the average price of avocados for each type?
- What were the total avocado sales for each week?
- Convert your CSV data to SQL using Convert CSV to SQL.
- Use the generated SQL file to create and populate the
avocado_salestable. - Run the queries in the
avocado_analysis.sqlfile against the database to explore and analyze the data.
Feel free to contribute additional questions or optimizations by submitting a pull request.