Provide Insights to Management in Consumer Goods Domain
Consumer Goods | Function : Excecutive Management
- Atliq Hardware (imaginary company) is one of the leading computer hardware producers in India and well expanded in other countries too.
- However, the management noticed that they do not get enough insights to make quick and smart data-informed decisions.
- Hence, company decided to conduct a SQL challenge which will help them to understand the data.
- Check ad-hoc-requests.pdf - there are 10 ad hoc requests for which the business needs insights.
- Need to run a SQL query to answer these requests.
- The target audience of this dashboard is top-level management - hence want to create a presentation to show the insights.
I've used MySQL to query the data base. The database file is available in atliq_hardware_db.sql file.
To convert this atliq_hardware_db.sql file into MySQL database, run the bellow codes.
- Connect to MySQL Server using terminal using
mysql -u root -p
and enter the password. - Once the connection is sucessfull type,
source RAW_Files/atliq_hardware_db.sql
to generate Atliq Hardware's database.
We can use the SQL_Query.sql to run all the queries using MySQL terminal or MySQL Workbench. To run using terminal use the code,
source SQL_Query.sql
We can utilize the MySQL python library and Jupyter Notebook for this. The SQL_Query.ipynb shows how to connect to a MySQL database using python and how to run the quries.
- This PDF file SQL_Query_Solutions.pdf contains all the qustion provided and the terminal outputs.
- Similarly images/mysql_terminal_solutions/ contains all the 10 query terminal outputs.
A sample slide from presentation
-
The presentations to the top-level management is stored in Presentation.pdf as PDF version and Presentation.pptx for powerpoint version.
-
The plots for the presentations was made using Plotly viisualization. The notebook used to create plots is Presentation_plots.ipynb.
- NOTE : This notebook is not a rendered one. Due to upload size restriction GitHub rejected the rendered one.
NOTE
-
More details of the problem statement and data is available at codebasics.io
-
credentials.py
only contains MySQL root password, it is created to protect the password. Bellow code shows what contains insidecredentials.py
file.
db_password = 'Type-your-MySQL-root-password-here'
- In
DB_to_CSV.py
file, the MySQL password entered as,
from credentials import db_password
mydb = mysql.connector.connect(host = 'localhost', user = 'root',
password = db_password, database = 'gdb023')
cursorObject = mydb.cursor()
Certificate of Appreciation from codebasics.io
The license can be found in the LICENSE file.