In Stag Ram Analytics Project
In Stag Ram Analytics Project
User Data
Overview:
The goal is to extract meaningful insights from the data to provide valuable information that can help
the product team at Instagram make informed decisions about the future direction of the app. By
analyzing user behavior, such as posting patterns, engagement levels, and popular hashtags, the project
seeks to support various teams within the business, such as marketing, product development, and
investor relations. Ultimately, the project aims to leverage SQL skills to derive insights that can
potentially influence the growth and development of one of the world's most popular social media
platforms, Instagram.
Approach:
To complete the project successfully, my approach involves the following steps:
1. Understanding the Data: Get familiar with the database schema and the tables containing
Instagram user data. Understand the relationships between different tables to effectively
extract insights.
2. Analyzing Requirements: Review the specific tasks outlined in the project, such as identifying
loyal users, inactive users, contest winners, popular hashtags, user engagement metrics, and
potential bot accounts.
3. Writing SQL Queries: Craft SQL queries to extract relevant data for each task, ensuring accuracy
and efficiency in querying the database.
4. Data Manipulation: Use SQL functions and operators to manipulate the data as needed to
derive the required insights.
5. Data Visualization: If necessary, visualize the extracted data using tools like MySQL Workbench
to enhance the presentation of insights.
6. Documentation: Document the SQL queries used, the outputs generated, and the insights
derived for each task in a clear and concise manner.
7. Report Preparation: Compiling the findings into a comprehensive report that includes the SQL
queries, outputs, and insights. Present the report in a format suitable for sharing with the
product team and leadership.
Tech-Stack Used:
1.MySQL Workbench
SQL TASKS
A) Marketing Analysis:
1. Loyal User Reward:
o SQL Query:
Query:
/*We want to reward our users who have been around the longest.
Find the 5 oldest users.*/
ORDER BY created_at
LIMIT 5;
Output:
id username created_at
80 Darby_Herzog 5/6/2016 0:14
67 Emilio_Bernier52 5/6/2016 13:04
63 Elenor88 5/8/2016 1:30
95 Nicole71 5/9/2016 17:30
38 Jordyn.Jacobson2 5/14/2016 7:56
Insights:
According to the SQL Query above the five oldest/most loyal customers names have
been found and this detail should be provided to Marketing team so that they can
reward them accordingly to encourage them for using the platform for so long.
o SQL Query:
Query :
/*We want to target our inactive users with an email campaign.
SELECT username
FROM users
o Output:
username
Aniya Hackett
Bartholome. Bernhard
Bethany20
Darby Herzog
David.Osinski47
Duane60
Esmeralda.Mraz57
Esther.Zulauf61
Franco_Keebler64
Hulda Macejkovic
Jaclyn81
Janelle.Nikolaus81
Jessyca_West
Julien_Schmidt
Kasandra_Homenick
Leslie67
Linnea59
Maxwell.Halvorson
Mckenna17
Mike.Auer39
Morgan.Kassulke
Nia_Haag
Ollie_Ledner37
Pearl7
Rocio33
Tierra.Trantow
username
Aniya_Hackett
Bartholome.Bernhard
Bethany20
Darby_Herzog
David.Osinski47
Duane60
Esmeralda.Mraz57
Esther.Zulauf61
Franco_Keebler64
Hulda.Macejkovic
Jaclyn81
Janelle.Nikolaus81
Jessyca_West
Julien_Schmidt
Kasandra_Homenick
Leslie67
Linnea59
Maxwell.Halvorson
Mckenna17
Mike.Auer39
Morgan.Kassulke
Nia_Haag
Ollie_Ledner37
Pearl7
Rocio33
Tierra.Trantow
Insights:
As we can see we have found 26 inactive users who have never posted anything .So this
information can be given to the marketing department so that they can target them with an
email campaign and try to get them to actively participate on the platform by posting photos
and spending more time on instagram to increase the usage.
o Query
/*We're running a new contest to see who can get the most likes on a single photo.
WHO WON??!!*/
SELECT
username,
photos.id,
photos.image_url,
COUNT(*) AS total
FROM photos
ON likes.photo_id = photos.id
ON photos.user_id = users.id
GROUP BY photos.id
LIMIT 1;
Output:
Insights:
Congratulations to Zack Kemmer who has become the contest winner of being the person who has
gotten maximum likes on a photo that is 48 times. She should be handsomely awarded and promoted by
the marketing team to get more traffic on the platform and encourage people to post more photos.
4. Hashtag Research:
o SQL Query:
Query :
/*A brand wants to know which hashtags to use in a post
FROM tags
o Output:
Insights:
The 5 most popular hashtags with their total is smile,beach,party,fun,concert. These
hashtags should be used by the investers to increase the reach of their posts.
5. Ad Campaign Launch:
o SQL Query:
Query:
/*What day of the week do most users register on?
FROM users
GROUP BY 1
ORDER BY 2 DESC;
o Output:
day of the
week total registration
Thursday 16
Sunday 16
Friday 15
Tuesday 14
Monday 14
Wednesday 13
Saturday 12
Insights:
As evident from above the maximum registrations happen on Thursday and Sunday . So
marketing team should launch the campaign on either Thursday or on a Sunday.
B) Investor Metrics:
1. User Engagement:
o SQL Query:
Query:
/*Total Posts by users */
SELECT SUM(user_posts.total_posts_per_user)
FROM users
FROM users
Output:
ROUND((SELECT
COUNT(*)FROM
photos)/(SELECT COUNT(*)
AS avg_post
FROM users),2)
2.57
Insights:
As we can see from above query the average post from users is 2 .
o SQL Query:
Query:
/*We have a small problem with bots on our site...
Find users who have liked every single photo on the site*/
FROM users
GROUP BY users.id
o Output:
id username total_likes_by_user
5 Aniya_Hackett 257
14 Jaclyn81 257
21 Rocio33 257
24 Maxwell.Halvorson 257
36 Ollie_Ledner37 257
41 Mckenna17 257
54 Duane60 257
57 Julien_Schmidt 257
66 Mike.Auer39 257
71 Nia_Haag 257
75 Leslie67 257
76 Janelle.Nikolaus81 257
91 Bethany20 257
Insights:
As we can see we have found 13 bots on the platform who have liked all 257 photos ,so
these bots should be flagges to maintain authenticity.