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 retweetsretweets
Tables Schema as Below:
UserTweetRelation
columnName dataType
id INT
createdat DATE
retweet VARCHAR
userid INT
tweetid INT
Input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
