Database for an Image Sharing platform (dubbed image-share), as the name suggests, is a database designed for providing SQL-database support for an image sharing platform.
Detailed documentation, and explanation of the database model and all its respective features (along with some examples of execution), can be found here.
Run the below given commands on an instance of a mysql server.
For creating the database, and setting up the relations, run source ./DDL.sql
.
Running source ./DDL2.sql
will do the trick as well. DDL2.sql is a script auto generated using MySQL Workbench's Forward Engineering feature.
You can view and verify the tables that have been created by running show tables;
For inserting the data into the tables, copy the below commands, and paste them directly onto the server-cli.
source ./insert/insert_1users.sql source ./insert/insert_2follows.sql source ./insert/insert_3tags.sql source ./insert/insert_4locations.sql source ./insert/insert_5photos.sql source ./insert/insert_6likes.sql source ./insert/insert_7comments.sql source ./insert/insert_8photo_tags.sql source ./insert/insert_9photo_locations.sql
source ./triggers/capture_unfollow.sql source ./triggers/prevent_self_follows.sql
You can view and verify the triggers that have been set up by running show triggers;
source ./queries/1.sql source ./queries/2.sql source ./queries/3.sql source ./queries/4.sql source ./queries/5.sql source ./queries/6.sql source ./queries/7.sql source ./queries/8.sql
This work was motivated by the database design and techniques adopted and taught by Colt.
However, it is to be noted that, although initially inspiration was drawn from the above-mentioned source, significant changes have been made to the database model and structure.