Instagram User Analytics
Instagram User Analytics
Analytics
Prepared by
Uzma Saiyed
Project Description
The Project is about finding out the various insights in Instagram
User database. We analyse this data on the following points:
Marketing
1. Loyal User Reward
2. Inactive User Engagement
3. Contest Winner Declaration
4. Hashtag Research
5. Launch AD Campaign
Investor Metrics
1. User Engagement
2. Bots & Fake Accounts
Task1:
Find the 5 oldest users of the Instagram from the database provided. • We
will use select statement to select username and created_at column from
users table. • We will use order by clause with asc in created_at column to
sort the output in ascending order. • Using limit function, we can display the
output for top 5 oldest users of the Instagram.
QUERY:-
select username, created_at from users order by created_at asc limit 5;
Task1:
Find the 5 oldest users of the Instagram from the database
provided.
Result:-
select username, created_at from users order by created_at asc limit
5;
Marketing
Inactive User Engagement: The team wants to encourage inactive
users to start posting by sending them promotional emails.
Task 2:
Identify users who have never posted a single photo on Instagram. • We will
use select statement to select username and user id column from users table
then assign alias for users table as u and photos table as p • we will left join
photos table on users table to retrieve photo id column from photos table on
u.id= p.user_id because both columns have common content. • Using where
clause we will filter rows from users table where p.id is null. • We will use order
by clause in id column in users table to sort the output.
Query :
select u.username, u.id from users u left join photos p on u.id= p.user_id where p.id is null
order by u.id;
Task 2:
Identify users who have never posted a
single photo on Instagram.
Query :
select u.username, u.id from users u left join
photos p on u.id= p.user_id
where p.id is null order by u.id;
Result:
Marketing
Contest Winner Declaration: The team has organized a contest
where the user with the most likes on a single photo wins.
Query :
select u.id, u.username, l.photo_id, p.image_url, count(*) as
no_of_likes from likes l inner join photos p on l.photo_id = p.id
Result:
Query :
select dayname(created_at) as day_of_week,
count(*) as no_of_users_registered from users group
by day_of_week order by no_of_users_registered
desc;
Marketing
Task 5:
Determine the day of the week when most users register on
Instagram.
Result :
Investor Metrics
User Engagement: Investors want to know if users are still
active and posting on Instagram or if they are making fewer
posts.
Query:
select count(*)/count(distinct user_id) as
Avg_num_of_post_per_user from photos;
Investor Metrics
Task 1: Calculate the average number of posts per user on
Instagram. Also, provide the total number of photos on
Instagram divided by the total number of users.
Result:
There are total 257 photos and total 74 distinct user in photo table which gives desired
output 257/74 =3.47. Average number of posts per user is 3.
Investor Metrics
Task 1: Calculate the average number of posts per user on
Instagram. Also, provide the total number of photos on Instagram
divided by the total number of users.
QUERY:-
select ((select count(*) from photos)/ (select count(*) from users)) as
total_no_of_photos_divide_total_no_of_users;
Result:
There are total 257 photos in
photos table and 100 user in
Task 2: Identify users (potential bots) who have liked every single
photo on the site, as this is not typically possible for a normal user. We
will use select statement to select user_id from Likes table and
username from users table.
We will use count function in distinct photo_id from Likes table and
assign alias for Likes table as l and users table u. Then we will left join
Users table on Likes table. Using group by clause we will get output
for each user. Then we will use having function to search values
count(*) from photos equal values to
total_no_of_photos_liked.
Investor Metrics
Task 2: Identify users (potential bots) who have liked every single
photo on the site, as this is not typically possible for a normal user.
Query :
select l.user_id, u.username, count(distinct l.photo_id) as
total_no_of_photos_liked from likes l left join users u
on l.user_id = u.id group by l.user_id
having total_no_of_photos_liked = (select count(*) from
photos)
Investor Metrics
Task 2: Identify users (potential bots)
who have liked every single photo on
the site, as this is not typically possible
for a normal user.
Result :
There are 30 users who have liked every single
photo on the site. They can be identified as bots
Or fake accounts.
Thanks!