Created an Instagram Database in which 7 Tables were integrated through primary and foreign keys. After database creation several tricky challenges were performed to through SQL queries. 7 tables are
- Comments
- Follows
- Likes
- Photo tags
- Photos
- Tags
- Users
- We want to reward our users who have been around the longest. Find the 5 oldest users.
- What day of the week do most users register on? We need to figure out when to schedule an ad campgain
- We want to target our inactive users with an email campaign. Find the users who have never posted a photo
- We're running a new contest to see who can get the most likes on a single photo. WHO WON??!!
- Our Investors want to know... How many times does the average user post? Total number of photos/total number of users
- User ranking by postings higher to lower
- Total Posts by users.
- Total numbers of users who have posted at least one time.
- A brand wants to know which hashtags to use in a post. What are the top 5 most commonly used hashtags?
- We have a small problem with bots on our site... Find users who have liked every single photo on the site
- We also have a problem with celebrities Find users who have never commented on a photo
- Find the count of users who have never commented on photo.
- Find users who have ever commented on a photo
- Find the count of users who have commented on a photo
- Are we overrun with bots and celebrity accounts? Find the percentage of our users who have either never commented on a photo or have commented on photos before