Sales Insights
Introduction This SQL project involves analyzing the sales and customer data of H+ Sport, a fictitious company that sells nutritional products and active lif...
This SQL project involves analyzing the sales and customer data of H+ Sport, a fictitious company that sells nutritional products and active lifestyle clothing. The focus is on the mineral water department, with the goal of improving sales and maintaining data accuracy. The project showcases a variety of SQL queries designed to manage, analyze, and interpret data, making it a valuable addition to a data science portfolio.
H+ Sport is dedicated to creating eco-friendly, high-quality, nutrient-rich nutritional products that enhance active lifestyles. The company also offers functional, stylish, comfortable, and durable activewear. H+ Sport was founded in 2006 by Henry Tool and sells products like supplements, energy bars, rehydration solutions, and mineral water. The company’s mineral water comes in six flavors: strawberry, raspberry, peach, orange, lemon lime, and blueberry.
The database used for this project is named hplussport and contains five tables:
Objective: Add a new grape flavor to the product table.
INSERT INTO Product (
ProductID,
ProductCode,
ProductName,
Size,
Variety,
Price,
Status
)
VALUES (
17,
'MWPRA20',
'Mineral Water',
20,
'Grape',
'1.79',
'ACTIVE'
);
Objective: Sort orders by their creation date in descending order.
SELECT *
FROM Orders
ORDER BY CreationDate DESC;
Objective: Identify and remove entries with null values in essential columns.
SELECT *
FROM Customer
WHERE FirstName IS NULL OR LastName IS NULL OR Email IS NULL OR Phone IS NULL;
SELECT FirstName, LastName, Email, Phone
FROM Customer
WHERE Email IS NOT NULL AND Phone IS NOT NULL;
Objective: Determine the total orders, quantities, and amount by month and year.
SELECT
MONTHNAME(CreationDate) AS MonthName,
YEAR(CreationDate) AS OrderYear,
MONTH(CreationDate) AS OrderMonth,
COUNT(Orders.OrderID) AS TotalOrders,
SUM(Quantity) AS TotalQuantity,
SUM(TotalDue) AS TotalAmount
FROM Orders
LEFT OUTER JOIN OrderItem
ON Orders.OrderID = OrderItem.OrderID
GROUP BY MonthName, OrderYear, OrderMonth
ORDER BY OrderYear, OrderMonth;
Objective: Find products that are no longer active.
SELECT *
FROM Product
WHERE Status = "DISCONTINUED";
Objective: Determine the top product sizes sold and the top three items based on quantity.
SELECT Size, SUM(Quantity) AS TotalQuantity
FROM OrderItem
LEFT OUTER JOIN Product
ON OrderItem.ProductID = Product.ProductID
GROUP BY Size
ORDER BY TotalQuantity DESC;
SELECT Variety, Size, SUM(Quantity) AS TotalQuantity
FROM OrderItem
LEFT OUTER JOIN Product
ON OrderItem.ProductID = Product.ProductID
GROUP BY Product.ProductID
ORDER BY TotalQuantity DESC
LIMIT 3;
Objective: Identify the top customers and salespeople who made no sales.
SELECT FirstName, LastName, COUNT(DISTINCT Orders.OrderID) AS TotalOrders, SUM(Quantity) AS TotalQuantity, SUM(TotalDue) AS TotalAmount
FROM Orders
LEFT OUTER JOIN OrderItem
ON Orders.OrderID = OrderItem.OrderID
LEFT OUTER JOIN Customer
ON Orders.CustomerID = Customer.CustomerID
GROUP BY Customer.CustomerID
ORDER BY TotalAmount DESC;
SELECT Salesperson.SalespersonID, FirstName, LastName
FROM Salesperson
LEFT OUTER JOIN Orders
ON Salesperson.SalespersonID = Orders.SalespersonID
WHERE Orders.SalespersonID IS NULL;
Objective: Calculate the percentage of customers who made more than one purchase.
WITH Repeat_Customers AS (
SELECT CustomerID AS Repeat_Cus
FROM Orders
GROUP BY CustomerID
HAVING COUNT(OrderID) > 1
)
SELECT
(COUNT(DISTINCT Repeat_Cus) / COUNT(DISTINCT CustomerID)) * 100 AS CustomerRepeatRate
FROM Orders
LEFT OUTER JOIN Repeat_Customers
ON Orders.CustomerID = Repeat_Customers.Repeat_Cus;
This SQL project provides comprehensive insights into H+ Sport’s customer and sales data, focusing on enhancing the mineral water department’s performance. By executing various SQL queries, the project highlights key data management and analysis skills, making it a valuable component of a data science portfolio.
Introduction This SQL project involves analyzing the sales and customer data of H+ Sport, a fictitious company that sells nutritional products and active lif...
Introduction Writing about your projects is crucial to giving context for the work. Writing an impactful article requires a structured approach that captures...
Introduction The project is to demonstrate the use of SQL to extract meaningful insights from a hospital database. This includes analysing patient demographi...
Your brain has two systems, a slow analytical side and a quick, instinctive “gut” side. For the most part, the instinctual side is lazy, conserving its energ...
“Color does not add a pleasant quality to design—it reinforces it.” — Pierre Bonnard
Tips for Designing a Color Palette In the first two sections of this book, Color Limitations and Color and Emotions, we looked at some interesting facts abou...
Color and Emotions Mention Thanksgiving to any American and they will paint a picture in their head with gold, orange, red, and brown hues. It will also like...
Background In 2019 I was awarded a Department of Education SBIR grant to build an educational board game about collaboration. Though the game would eventuall...
To see a preview of this project go to Shuffling Cards on Codespaces and select the index.html file and then go live on the status bar.
Piece of Cake
Alika’s Treehouse Background This project won the Capital One Women In Tech Demo Day. The challenge, “Help young women of color see themselves as a Computer ...
Time and pressure can change almost anything from what it was into what it has become. Time will change, “Caterpillar into butterflies, sand into pearls...
“You can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your ...
Looking back on my career, there are a few things I wish I had done earlier to boost my career progression and enhance my marketability. In this article, I w...
“No struggle, no success! The strongest thunder strikes often bring the heaviest rainfall! The weight of your fulfillment depends on how wide you cast you...