Question: Write a query to count retweet and tweets. The output table should contain columns 'type' and 'count'. For retweeted type = 'retweet' otherwise type =

Write a query to count retweet and tweets. The output table should contain columns 'type' and 'count'. For retweeted type = 'retweet' otherwise type = 'not retweet' for tweets which are never retweeted. Try using Case statement. 'count' is the count of retweets/retweets.
Tables Schema as Below:
UserTweetRelation
columnName dataType
id INT
created_at DATE
retweet VARCHAR(50)
user_id INT
tweet_id INT
Input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!