Project Report-7
Project Report-7
submitted by
2 Objective 4
3 Data Description 4
3.1 Data dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 ER Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Business Questions 5
4.1 Question-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.1 Find the total number of customers who have placed orders? What is the distribution of the
customers across states? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Question-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2.1 Which are the top 5 vehicle makers preferred by the customers? . . . . . . . . . . . . . . . . . . 7
4.2.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.3 Question-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3.1 Which is the most preferred vehicle maker in each state? . . . . . . . . . . . . . . . . . . . . . 8
4.3.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4 Question-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4.1 Find the overall average rating given by the customers. What is the average rating in each quarter? 9
4.4.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 Question-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5.1 Find the percentage distribution of feedback from the customers. Are customers getting more
dissatised over time? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.5.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6 Question-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.1 What is the trend of the number of orders by quarter? . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.5 Business Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7 Question-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7.1 Calculate the net revenue generated by the company. What is the quarter-over-quarter % change
in net revenue? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.7.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8 Question-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8.1 What is the trend of net revenue and orders by quarters? . . . . . . . . . . . . . . . . . . . . . . 13
4.8.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.8.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.9 Question-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.9.1 What is the average discount oered for dierent types of credit cards? . . . . . . . . . . . . . . 14
4.9.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.9.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.9.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.9.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.10 Question-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10.1 What is the average time taken to ship the placed orders for each quarter? . . . . . . . . . . . . 15
4.10.2 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10.4 Observations and Insights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10.5 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 Business Metrics Overview 15
2 Objective
New-Wheels sales have been dipping steadily in the past year, and due to the critical customer feedback and ratings
online, there has been a drop in new customers every quarter, which is concerning to the business. The CEO of the
company now wants a quarterly report with all the key metrics sent to him so he can assess the health of the business
and make the necessary decisions.
As a data analyst, you see that there is an array of questions that are being asked at the leadership level that need
to be answered using data. Import the dump le that contains various tables that are present in the database. Use the
data to answer the questions posed and create a quarterly business report for the CEO.
3 Data Description
The data provided has
1. Attributes on the vehicles New-Wheels sells - What are the make, model, and year? What is the price point?
2. Attributes on the customers, such as where they live and payment methods
3. Attributes on orders and shipments, such as when the order was shipped and received, what the after-sales feedback
was, and so on.
l discount: Discount given to the customer for the particular order by credit card in percentage
l credit_card_type: Credit Card Type
l credit_card_number: Credit card number
l customer_feedback: Feedback of the customer
3.2 ER Diagram
Figure 1: ER diagram
4 Business Questions
Note - I have completed this project in Mysql and SQLite platform both. The codes I have provided in this document are
from Mysql and the codes for the SQLite platform are submitted in the website itself under the section SQL Playground
- Coded Project.
5
4.1 Question-1
4.1.1 Find the total number of customers who have placed orders? What is the distribution of the customers
across states?
4.1.2 Query
WITH s t a t e w i s e _ c u s t o m e r s AS (
SELECT c . s t a t e ,
COUNT(DISTINCT c . c u s t o m e r _ i d ) AS T o t a l _ c u s t o m e r s
FROM c u s t o m e r _ t c
JOIN o r d e r _ t o ON c . c u s t o m e r _ i d = o . c u s t o m e r _ i d
GROUP BY c . s t a t e
)
SELECT * , SUM( T o t a l _ c u s t o m e r s ) OVER ( ) AS T o t a l _ c u s t o m e r s _ w i t h _ o r d e r s
FROM s t a t e w i s e _ c u s t o m e r s
ORDER BY T o t a l _ c u s t o m e r s DESC;
4.1.3 Output
l Customers with Orders: All 994 listed customers have placed orders, indicating high conversion.
l Regional Market Penetration: The top 4 states dominate sales, while others may suer from low demand or
weak marketing.
l Business Implications: Analyzing revenue per customer and customer feedback is crucial. Low-engagement states
need targeted promotions.
4.1.5 Recommendations
l Boost Sales in Low-Engagement States: Launch promotions and strengthen dealer partnerships.
l Enhance Retention in Key Markets: Improve after-sales service and introduce loyalty programs.
l Investigate Customer Satisfaction: Analyze complaints regarding shipping, vehicle quality, and pricing.
l Optimize Pricing Strategy: Assess revenue per customer, segment data by vehicle model, price, and discounts.
6
4.2 Question-2
4.2.1 Which are the top 5 vehicle makers preferred by the customers?
4.2.2 Query
SELECT
p . vehicle_maker ,
COUNT( o . c u s t o m e r _ i d ) AS c u s t o m e r _ c o u n t
FROM p r o d u c t _ t p
JOIN o r d e r _ t o ON p . p r o d u c t _ i d = o . p r o d u c t _ i d
GROUP BY p . v e h i c l e _ m a k e r
ORDER BY c u s t o m e r _ c o u n t DESC;
4.2.3 Output
4.2.5 Recommendations
l Stock Optimization: Focus on high-demand brands to improve inventory eciency.
l Targeted Marketing: Promote lesser-sold brands via discounts and advertising.
7
l Customer Insights: Conduct surveys to understand brand preferences better.
l Sales Strategy: Oer bundled deals or nancing options to boost sales for mid-tier brands.
4.3 Question-3
WITH V e h i c l e R a n k AS (
SELECT
c . state ,
p . vehicle_maker ,
COUNT(DISTINCT c . customer_id ) AS customer_count ,
RANK( ) OVER (PARTITION BY c . s t a t e ORDER BY COUNT(DISTINCT c.
customer_id ) DESC) AS r n k
FROM c u s t o m e r _ t c
JOIN o r d e r _ t o ON c . c u s t o m e r _ i d = o . c u s t o m e r _ i d
JOIN p r o d u c t _ t p ON o . p r o d u c t _ i d = p . p r o d u c t _ i d
GROUP BY c . s t a t e , p . v e h i c l e _ m a k e r
)
SELECT
state , vehicle_maker , customer_count
FROM V e h i c l e R a n k
WHERE r n k = 1 ;
4.3.3 Output
8
4.3.4 Observations and Insights
l State-Wise Vehicle Preference: Chevrolet, Dodge, and Toyota dominate as preferred vehicle makers in multiple
states, indicating strong customer trust in these brands.
l Diverse Preferences: Some states have multiple top vehicle makers with the same customer count, suggesting a
competitive resale market.
l Market Concentration: California and Florida show higher customer counts per vehicle maker, reinforcing them
as key markets.
l Low Customer Engagement: Several states have only 1-2 customers per top-ranked vehicle maker, indicating
potential marketing gaps.
4.3.5 Recommendations
l Strengthen Popular Brand Sales: Optimize supply chain and inventory for Chevrolet, Dodge, and Toyota to
meet demand eciently.
l Expand Low-Engagement States: Implement targeted promotions to attract more customers in states with
minimal sales.
l Competitive Analysis: Study states with shared top vehicle makers to identify dierentiating factors driving
customer choices.
l Improve Regional Strategies: Customize advertising and dealership collaborations based on state-wise prefer-
ences.
4.4 Question-4
4.4.1 Find the overall average rating given by the customers. What is the average rating in each quarter?
4.4.2 Query
SELECT
CASE
WHEN quarter_number I S NULL THEN ' O v e r a l l Average '
ELSE quarter_number
END AS q u a r t e r _ i n f o ,
AVG( r a t i n g ) AS a v g _ r a t i n g
FROM (
SELECT
quarter_number ,
CASE
WHEN customer_feedback = ' Very Bad ' THEN 1
WHEN customer_feedback = ' Bad ' THEN 2
WHEN customer_feedback = ' Okay ' THEN 3
WHEN customer_feedback = ' Good ' THEN 4
WHEN customer_feedback = ' Very Good ' THEN 5
ELSE NULL
END AS r a t i n g
FROM order_t
) AS f e e d b a c k _ s c o r e s
GROUP BY quarter_number WITH ROLLUP ;
Note - 'WITH ROLLUP' function is not working in SQL Playground but I have used MYSQL so it is perfectly working.
4.4.3 Output
4.4.5 Recommendations
l Service Improvement: Address key concerns from customer feedback to enhance experience.
l Product Quality Check: Investigate quality issues leading to negative perceptions.
l Proactive Engagement: Improve customer support to prevent dissatisfaction.
l Targeted Promotions: Oer incentives in Q3 and Q4 to improve ratings.
4.5 Question-5
4.5.1 Find the percentage distribution of feedback from the customers. Are customers getting more dissat-
ised over time?
4.5.2 Query
SELECT
quarter_number ,
COUNT ( * ) AS Total_Feedback ,
ROUND( 1 0 0 . 0 * SUM ( CASE WHEN customer_feedback = ' Very Bad ' THEN 1 ELSE 0 END ) / COUNT ( * ) , 2 ) AS Very_Bad_Perc ,
ROUND( 1 0 0 . 0 * SUM ( CASE WHEN customer_feedback = ' Bad ' THEN 1 ELSE 0 END ) / COUNT ( * ) , 2 ) AS Bad_Perc ,
ROUND( 1 0 0 . 0 * SUM ( CASE WHEN customer_feedback = ' Okay ' THEN 1 ELSE 0 END ) / COUNT ( * ) , 2 ) AS Okay_Perc ,
ROUND( 1 0 0 . 0 * SUM ( CASE WHEN customer_feedback = ' Good ' THEN 1 ELSE 0 END ) / COUNT ( * ) , 2 ) AS Good_Perc ,
ROUND( 1 0 0 . 0 * SUM ( CASE WHEN customer_feedback = ' V e r y Good ' THEN 1 ELSE 0 END ) / COUNT ( * ) , 2 ) AS V er y_ Go o d_ Pe rc
FROM o r d e r _ t
GROUP BY q u a r t e r _ n u m b e r
ORDER BY q u a r t e r _ n u m b e r ;
4.5.3 Output
10
4.5.4 Observations and Insights
l Rising Customer Dissatisfaction: The percentage of *Very Bad* feedback has increased from 10.97% in Q1 to
30.65% in Q4, indicating worsening service quality.
l Declining Positive Feedback: The combined percentage of *Good* and *Very Good* ratings dropped signicantly
from 58.71% in Q1 to 20.10% in Q4, reecting a decline in customer satisfaction.
l Decreasing Customer Engagement: The total number of feedback entries has reduced over quarters, from 310
in Q1 to 199 in Q4, suggesting a shrinking customer base.
l Surge in Negative Feedback: The combined percentage of *Very Bad* and *Bad* ratings increased from 22.26%
in Q1 to 59.80% in Q4, highlighting serious customer dissatisfaction.
4.5.5 Recommendations
l Enhance After-Sales Support: Implement proactive customer service strategies, including quicker issue resolution
and better post-purchase engagement.
l Improve Product and Delivery Standards: Conduct a detailed analysis of delivery delays and vehicle quality
concerns to address recurring complaints.
l Launch Retention Programs: Introduce loyalty benets, extended warranties, and personalized discounts to retain
customers.
l Monitor Competitor Strategies: Investigate competitor pricing and service oerings to identify gaps and improve
customer satisfaction.
4.6 Question-6
SELECT
quarter_number ,
COUNT( o r d e r _ i d ) AS t o t a l _ o r d e r s
FROM order_t
GROUP BY quarter_number
ORDER BY quarter_number ;
4.6.3 Output
11
Negative Feedback: Poor service or vehicle issues may discourage repeat customers.
Market Competition: Competitors might be oering better deals.
Economic Factors: Ination or nancial constraints could be aecting purchasing power.
4.7 Question-7
4.7.1 Calculate the net revenue generated by the company. What is the quarter-over-quarter % change in
net revenue?
4.7.2 Query
4.7.3 Output
12
4.7.5 Recommendations
l Customer Retention: Improve after-sales service to boost trust.
l Strategic Pricing: Oer discounts in low-sales quarters.
l Brand Enhancement: Act on feedback to improve perception.
4.8 Question-8
SELECT
quarter_number ,
SUM( v e h i c l e _ p r i c e * (1 = d i s c o u n t ) * q u a n t i t y ) AS net_revenue ,
COUNT( DISTINCT o r d e r _ i d ) AS t o t a l _ o r d e r s
FROM order_t
GROUP BY quarter_number
ORDER BY quarter_number ;
4.8.3 Output
l Q4 Lowest Sales: Net revenue stabilizes but remains low, with orders decreasing further.
4.8.5 Recommendations
l Revamp Marketing: Re-engage customers with promotions and loyalty programs.
l Targeted Discounts: Oer strategic price reductions to boost Q2-Q3 sales.
13
4.9 Question-9
4.9.1 What is the average discount oered for dierent types of credit cards?
4.9.2 Query
SELECT
c . credit_card_type ,
AVG( o . d i s c o u n t ) AS avg_discount
FROM customer_t c
JOIN order_t o ON o . customer_id = c . customer_id
GROUP BY c . c r e d i t _ c a r d _ t y p e
ORDER BY avg_discount DESC ;
4.9.3 Output
l Popular Cards: Visa and Mastercard are widely used, but their discounts are not the highest.
4.9.5 Recommendations
l Strategic Partnerships: Focus on collaborations with banks oering high-discount cards to drive sales.
l Targeted Promotions: Oer exclusive deals for lower-discount cardholders to balance the distribution.
l Discount Optimization: Re-evaluate discount policies for frequently used cards like Visa and Mastercard.
l Customer Engagement: Conduct surveys to understand why certain cardholders receive higher discounts.
14
4.10 Question-10
4.10.1 What is the average time taken to ship the placed orders for each quarter?
4.10.2 Query
SELECT
quarter_number ,
AVG(DATEDIFF( ship_date , order_date ) ) AS avg_shipping_time
FROM order_t
GROUP BY quarter_number
ORDER BY quarter_number ;
4.10.3 Output
4.10.5 Recommendations
l Optimize Supply Chain: Identify bottlenecks in logistics and implement faster shipping methods.
l Inventory Management: Maintain stock closer to high-demand regions to reduce shipping delays.
l Strategic Partnerships: Collaborate with ecient shipping vendors to streamline delivery processes.
l Customer Communication: Provide real-time tracking and proactive updates to manage customer expectations.
Last Quarter Revenue Last quarter Orders Average Days to Ship % Good Feedback
Note: % Good Feedback includes both 'Good' and 'Very Good' ratings.
15
6 Actionable Insights and Business Recommendations
6.1 Key Insights
l Declining Orders: Orders fell 35.8% from Q1 to Q4, indicating potential customer dissatisfaction or seasonal
factors.
l Increasing Negative Feedback: "Very Bad" ratings surged from 10.97% in Q1 to 30.65% in Q4, while positive
ratings dropped from 58.71% to 20.10%.
l Falling Revenue: Net revenue consistently declined quarter-over-quarter, with discounts failing to drive sucient
growth.
l Shipping Delays: Prolonged average shipping times could be impacting customer satisfaction and retention.
l Declining Customer Satisfaction: Average ratings steadily fell from 3.55 in Q1 to 2.39 in Q4, reecting a
downward trend in perceived service quality.
l Credit Card Discounts: Variation in discount rates based on credit card type suggests potential for customized
promotional strategies.
l Preferred Vehicle Makers: Leading brands dominate in most states, with customer loyalty inuencing purchase
decisions.
l Enhance Customer Experience: Improve after-sales support, address major service issues, and implement quality
assurance measures to reverse the downward trend in customer satisfaction.
l Improve Competitive Positioning: Conduct competitor benchmarking to optimize pricing strategies and rene
product oerings.
l Targeted Promotions: Launch strategic discount campaigns, especially in Q4, to counteract declining sales and
boost customer retention.
l Streamline Logistics: Reduce shipping delays by optimizing delivery processes, improving vendor coordination,
and enhancing supply chain eciency.
l Strengthen Marketing Strategies: Utilize customer feedback to highlight positive experiences, promote brand
reputation, and rebuild trust.
l Leverage Customer Data: Personalize oers based on purchasing patterns, feedback trends, and satisfaction
scores to drive engagement and repeat sales.
l Proactive Engagement: Address customer concerns early, introduce loyalty programs, and enhance communica-
tion to foster long-term relationships.
16