This is a MySQL database clone for Instagram that contains tables for users, photos, comments, likes, follows, tags, and photo_tags. It also includes some example SQL queries that can be used to extract information from the database.
To use this database clone, simply copy and paste the code into a MySQL server and run the queries as needed. Make sure to update the database name in the code if necessary.
- users: stores information about Instagram users
- photos: stores information about photos uploaded by users
- comments: stores information about comments made on photos
- likes: stores information about likes made on photos
- follows: stores information about followers and followees
- tags: stores information about hashtags used on photos
- photo_tags: stores information about the association between photos and hashtags
The following are some example SQL queries that can be used to extract information from the Instagram database:
- Select all users
- Select top 5 oldest users
- Day of week most users registered on
- Users who never posted a photo
- Photo with most likes and user who created it
- Average comments per user
- Average photos per user
- Top 5 most popular hashtags
- Users who like every photo on site (possible bots)