You are on page 1of 8

2/5/23, 9:07 PM SQL Project on clone Instagram dataset?

| by Nilesh Kodag | Medium

Open in app Sign up Sign In

Search Medium

Nilesh Kodag Follow

Jan 28, 2022 · 2 min read · Listen

Save

SQL Project on clone Instagram dataset?


Let’s dive to business, You are a business analyst or data analyst for a particular
company and your boss want some information from you about the dataset and want to
take some small decision.

How you can help him?


Step 1: Sit on a chair & turn your computer on
Step 2: Ask some serious questions about what he wants to know from the particular
dataset(Hope you are sitting with pen & paper )
Step 3: Now open youtube and start some song you like

Elvis Presley - Can't Help Falling In Love (Official Audio)

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 1/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

My suggestion

Now open your query editor and start your google to get some answers.

Boss: Nilesh I need to reward some user’s who have been with us for a long period of
time. Give me the top 5 names to me

Nilesh :

SELECT * FROM users


ORDER BY created_at
LIMIT 5;

Boss: nice, tell me the day the user registered with count

Nilesh:

SELECT date_format(created_at,'%W') AS 'day of the week', COUNT(*) AS


'total registration'
FROM users
GROUP BY 1
ORDER BY 2 DESC;

/*version2*/
SELECT
DAYNAME(created_at) AS day, COUNT(*) AS total
FROM
users
GROUP BY day
ORDER BY total DESC
LIMIT 2;

Boss: Thursday nice, Hey what about users who have not added any photos

Nilesh: anime images

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 2/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 3/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

Photo by AC De Leon on Unsplash

Boss: no I need a number

Nilesh: oh my bad

select username from users


left join photos on users.id=photos.user_id
where photos.id is null;

Boss: that lot! Nilesh let's run some context so we can get more user on the app/website

Nilesh: anime fight??

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 4/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 5/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

Photo by Jeet Dhanoa on Unsplash

boss: I need a number

Nilesh:

select users.username, photos.id,photos.image_url,count(*) as


total_likes
from likes
join photos on photos.id=likes.photo_id
join users on users.id=likes.photo_id
group by photos.id
order by total_likes desc
limit 10;

Boss: we just found a new investor, I have to show him avg posting time on our
app/website

Nilesh: ohh nice!!!! now I can earn more to buy more manga’s for me

Boss: Nilesh number!!!!

Nilesh :

SELECT ROUND((SELECT COUNT(*)FROM photos)/(SELECT COUNT(*) FROM


users),2);

Boss: we got funding…..! and you got to raise. Now give me user high to low in ranking

Nilesh:

SELECT users.username,COUNT(photos.image_url)
FROM users
JOIN photos ON users.id = photos.user_id
GROUP BY users.id
ORDER BY 2 DESC;

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 6/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

Boss: good let’s target users who posted anything at least once

Nilesh:

select count(distinct(users.id)) as total_no


from users
join photos on users.id=photos.user_id;

Meet Nilesh @Nilesh kodag

Nilesh Kodag - Marketing Analyst - Board Infinity | LinkedIn


Hi, I'm Nilesh Kodag. data analyst and MBA student(Marketing) During
my Bachelor's in aircraft maintenance engineering…
www.linkedin.com

Sql Project Instagram Database Database Nilesh Kodag

Get an email whenever Nilesh Kodag publishes.

Your email

Subscribe

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 7/8
2/5/23, 9:07 PM SQL Project on clone Instagram dataset? | by Nilesh Kodag | Medium

About Help Terms Privacy

Get the Medium app

https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 8/8

You might also like