50% found this document useful (2 votes)
653 views6 pages

Instagram User Analysis

The project involves analyzing an Instagram user database to gain insights. The analysis includes finding the oldest users, users who have not posted photos, the contest winner, top hashtags, peak registration days, average user posts, total photos, and identifying bot accounts. SQL queries using functions like TOP, ORDER BY, JOIN, COUNT, GROUP BY, and HAVING are written to answer each question. Key insights found are that Thursday sees the most new registrations, so that would be best for advertising, and the average number of posts per user and total photos on the site. Potential bot accounts are also identified.

Uploaded by

Jinkal Darji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
653 views6 pages

Instagram User Analysis

The project involves analyzing an Instagram user database to gain insights. The analysis includes finding the oldest users, users who have not posted photos, the contest winner, top hashtags, peak registration days, average user posts, total photos, and identifying bot accounts. SQL queries using functions like TOP, ORDER BY, JOIN, COUNT, GROUP BY, and HAVING are written to answer each question. Key insights found are that Thursday sees the most new registrations, so that would be best for advertising, and the average number of posts per user and total photos on the site. Potential bot accounts are also identified.

Uploaded by

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

PROJECT DESCRIPTION

The project is about finding out the various insights in Instagram User database. We analyze this
data and some following questions:

1) Find the 5 oldest users of the Instagram from the database provided
2) Find the users who have never posted a single photo on Instagram
3) Identify the winner of the contest and provide their details to the team
4) Identify and suggest the top 5 most commonly used hashtags on the platform
5) What day of the week do most users register on? Provide insights on when to schedule an
ad campaign
6) Provide how many times does average user posts on Instagram. Also, provide the total
number of photos on Instagram/total number of users
7) Provide data on users (bots) who have liked every single photo on the site (since any
normal user would not be able to do this).

APPROACH

I have analyzed the database carefully. Observe all the tables, columns, rows, and relationship
among all the tables. Then I have started to create tables in mysql server. After finishing creating
table, I have added the data into each table. Afterwards check all the tables’ content carefully.
Then one by one I have executed queries according to the questions asked.

TECH-STACK USED

I have used Microsoft SQL Server Management Studio to execute my sql queries because it is
cost-free and give advanced user experience.

INSIGHTS

I have gained knowledge of various SQL functions which helped me to solve the questions asked
in this project.

Following are the functions I used:

TOP, ORDER BY, JOIN, COUNT, GROUP BY, HAVING


A) Marketing:

Task - 1 Find the 5 oldest users of the Instagram from the database provided

Query:

SELECT TOP 5 username, created_at FROM users


ORDER BY created_at ASC

Output:

Task-2 Find the 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.user_id IS NULL

Output:
Task-3 Identify the winner of the contest and provide their details to the team

Query:

SELECT COUNT(*) AS Number_of_likes, l.user_id FROM likes l


JOIN users u ON u.id = l.user_id
GROUP BY l.user_id
ORDER BY Number_of_likes DESC
Output:

Task-4 Identify and suggest the top 5 most commonly used hashtags on the platform

Query:

SELECT TOP 5 t.tag_name FROM tags t


JOIN photo_tags pt ON pt.tag_id = t.id
GROUP BY t.tag_name

Output:

Task-5 What day of the week do most users register on? Provide insights on when to
schedule an ad campaign

Query:

SELECT FORMAT(created_at, N'dddd","dd MMMM yyyy', 'en-US') AS Date, COUNT(*) AS


Num FROM users
GROUP BY created_at

Output:

The team need to arrange ad campaign on Thursday as there are more users registered on
Thursday.
B) Investor Metrics:

Task-1 Provide how many times does average user posts on Instagram. Also, provide the
total number of photos on Instagram/total number of users

Query:

SELECT
COUNT(*) / COUNT(DISTINCT(p.user_id)) AS AvgPostsPerUsers,
COUNT(p.image_url) AS TotalNumOfPosts
FROM photos p

Output:

Total Number of users:

Query:
SELECT COUNT(id) AS TotalNumOfUsers FROM users

Output:

Task-2 Provide data on users (bots) who have liked every single photo on the site (since any
normal user would not be able to do this).

Query:

SELECT user_id AS FakeAccountID FROM likes GROUP BY user_id


HAVING COUNT(user_id)=(SELECT COUNT(image_url) FROM photos)

Output:

You might also like