Professional Documents
Culture Documents
Search Medium
Save
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 :
Boss: nice, tell me the day the user registered with count
Nilesh:
/*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
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
Nilesh: oh my bad
Boss: that lot! Nilesh let's run some context so we can get more user on the app/website
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
Nilesh:
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
Nilesh :
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:
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
https://kodagnilesh.medium.com/sql-project-on-clone-instagram-dataset-a537d0f60d4b 8/8