The included SQL script aims to answer business questions from the Northwind Traders database, a database of customer, order, product and employee data for a wholesale gourmet food company called Northwind Traders.
The aim of the project was to ask questions and use the data to find answers related to the following themes:
- Evaluating employee performance to boost productivity,
- Understanding product sales and category performance to optimize inventory and marketing strategies.
- Analyzing sales growth to identify trends, monitor company progress, and make more accurate forecast.
- Evaluating customer purchase behavior to target high-value customers with promotional incentives
- Employee performance
- Which employees have performed the best in terms of sales?
- Product sales and category performance
- Which products and categories are sold most often?
- Which products generate the most revenue?
- *Sales trends
- Which periods of the year account for the highest and lowest revenue?
- Customer purchase behavior
- Which products are commonly bought together?
- Which customers return most often?
- What is the average number of items per order?
The SQL script was written based on the PostgreSQL version of the Northwind Traders database.
You will need to have PostgreSQL installed on your local machine.
You will also need to download and populate the Northwind Traders database locally.
The Northwind Traders database is available on Github and there are instructions for downloading and installing both PostgreSQL and the database here
Once you have downloaded and installed PostgreSQL and poopulated the Northwind Traders database locally, you will need to choose a program to open and view the database tables and run the SQL script from this repository.
I used DBeaver for my database management and script writing, but other options include JupyterLab, BeeKeeper Studio, etc.
DBeaver is available for download, with installation instrcutions, here.
The SQL script contains multiple queries.
It is commented to indicate which queries are useful to answer each question (Q1, Q2, etc.).
Queries can be run individually in a database tool, such as DBeaver, by dragging and selecting an individual entire query before executing. Multiple queries can not be run together.
Questions answered in the current script:
- Q1) Which employees have performed the best in terms of sales?
- Q2) Which products and categories are sold most often?
- Q3) Which products generate the most revenue?
- Q4) Which periods of the year account for the highest and lowest revenu
- Q5) Which products are commonly bought together?
- Q6) Which customers return most often?
- Q7) What is the average number of items per order?
Questions for future updates:
- [] Q8) What are the most common products in the Top 20 orders by value?
- [] Q9) What is the average length of time between a customer placing an order and the ship date?
Distributed under the MIT License. See LICENSE.txt
for more information.