0% found this document useful (0 votes)
11 views9 pages

CREATE DATABASE Ig

Uploaded by

Nikhil honrao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

CREATE DATABASE Ig

Uploaded by

Nikhil honrao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Marketing Analysis:

Task 1 - Identify the five oldest users on Instagram from the provided database.

SELECT * FROM users


ORDER BY created_at ASC
LIMIT 5;

RESULT :- Five oldest users on Instagram.


Task 2 - Identify users who have never posted a single photo on Instagram.

SELECT * FROM users


WHERE id NOT IN (SELECT DISTINCT user_id FROM photos);

RESULT :- Users who have never posted a single photo on Instagram.

FIG.1

FIG.2
Task 3 - Determine the winner of the contest and provide their detail to the team.

SELECT u.username, p.id AS photo_id, COUNT(*) AS total_likes


FROM users u
INNER JOIN photos p ON u.id = p.user_id
INNER JOIN likes l ON p.id = l.photo_id
GROUP BY u.username, p.id
ORDER BY total_likes desc
LIMIT 1;

RESULT :- User with the most likes on a single photo.


Task 4 – identify and suggest the top five most commonly used hashtags on the
platform.
SELECT tag_name, COUNT(*) as tag_count
FROM photo_tags
JOIN tags ON photo_tags.tag_id = tags.id
GROUP BY tag_name
ORDER BY tag_count DESC
LIMIT 5;

RESULT :- Top five most commonly used hashtags


Task 5 – Determine the day of the week when most users register on Instagram.

SELECT DAYNAME(created_at) as day_of_week,


COUNT(*) as user_count
FROM users
GROUP BY day_of_week
ORDER BY user_count DESC;

RESULT :- The day of the week when most users register on Instagram.
B) 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.

SELECT COUNT(*) as total_photos,


COUNT(DISTINCT user_id) as total_users,
COUNT(*) / COUNT(DISTINCT user_id) as avg_posts_per_user
FROM photos;

RESULT :- Average number of posts per user on Instagram.


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.

SELECT user_id, COUNT(*) as total_likes


FROM likes
GROUP BY user_id
HAVING total_likes = (SELECT COUNT(*) FROM photos);

RESULT :- Who have liked every single photo.


Project Description
This project aimed to work on the SQL queries to extract valuable data
from the Instagram database. The goal was the valuable data to marketing
team with some of the necessary tasks like identifying loyal users, find
out inactive users, determining contest winners, popular hashtags, and
which days is better for ad campaign launch timing.

Approach
o I understand the structure of the provided database including tables
for users, posts, photos, hashtags and likes.
o Done the marketing task through SQL queries. Like royale users,
inactive users, popular hashtags and more like.
o Used SQL queries for each marketing task joins, aggregations, and
group by techniques.
o Successfully executed the queries and analyzed the results extract
the necessary information like usernames, created dates, photo
likes, hashtag counts.
o Extract the data to identify loyal users, inactive users, contest
winners, popular hashtags, and the most frequent day of user
registration.

Tech-Stack Used
I used MySQL Community Server version 8.4.0 with DB gate software.
I prefer DB gate because for me this is user friendly interface like a
creating a tables, write and execute the SQL queries.

Insights:
 By identifying loyal users, we can create targeted reward programs
to increase user retention.
 Target the inactive users with promotional emails.
 Understanding popular hashtags allows for better content creation.
 Knowing the most popular day for user registration helps schedule
an ad campaigns for more useful impact.
 Who is inactive user send the promotional messages, emails for
rejoin the Instagram.
Results:
This project successfully demonstrated the SQL in extracting valuable
marketing data from an Instagram database. The extracted data can be
used for marketing team to make decisions regarding user engagement,
contest management, content strategy, and ad campaign.

You might also like