Question: The language is SQL You are creating a Twitter clone and need to design your database from scratch based on observing the kinds of details
The language is SQL
You are creating a Twitter clone and need to design your database from scratch based on observing the kinds of details Twitter stores and how it fits together. Your table schema should support user profiles, tweeting, retweeting, liking, and replying.
For this exercise you will not be provided with the specific data that needs to be stored, it will be up to you to work out what data you need and how best to store it.
To simplify our needs, you can assume that:
Anywhere you want to allow images will be stored as just an image file path (i.e. just make something up like '/user_pics/username.jpg' and store that in the database).
Replies are all stored as replies to the original tweet, never as replies to another reply.
Your task is to:
Determine Map out your tables using ER Diagrams with the appropriate relationship cardinality markers.
Use your diagram to create the tables, making sure to define the foreign keys.
Populate your database so that you have:
2 users
5 tweets
3 replies
5 retweets
10 likes
Then write queries to display:
All tweets, from newest to oldest.
All tweets from today.
Retweets of a particular tweet.
The number of likes for a particular tweet.
The total number of replies per user for each tweet (i.e. for each tweet, how many replies did each person who responded send).
Step by Step Solution
There are 3 Steps involved in it
To design a database for a Twitter clone with SQL as outlined we need to establish a set of tables that represent users tweets likes retweets and replies Below is a detailed breakdown with steps inclu... View full answer
Get step-by-step solutions from verified subject matter experts
