Back to problems

Tweets' Rolling Averages

SQL · xAI · Medium

Description The table tweets records one row for each user on each date, with the number of tweets posted that day. > > >(user_id, tweet_date) is the primary key for this table. Write a query that computes, for each user, a three-day rolling average of tweet_count. For any given date, the average uses that day's count plus the counts from the user's two preceding dates. Round the result to 2 decimal places, name the output column rolling_avg_3d, and order the rows by user_id…

Checking your access…