"content":"<p>Table: <code>Activity</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| user_id | int |\n| session_id | int |\n| activity_date | date |\n| activity_type | enum |\n+---------------+---------+\nThere is no primary key for this table, it may have duplicate rows.\nThe activity_type column is an ENUM of type ('open_session', 'end_session', 'scroll_down', 'send_message').\nThe table shows the user activities for a social media website. \nNote that each session belongs to exactly one user.\n</pre>\n\n<p> </p>\n\n<p>Write an SQL query to find the daily active user count for a period of <code>30</code> days ending <code>2019-07-27</code> inclusively. A user was active on someday if they made at least one activity on that day.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nActivity table:\n+---------+------------+---------------+---------------+\n| user_id | session_id | activity_date | activity_type |\n+---------+------------+---------------+---------------+\n| 1 | 1 | 2019-07-20 | open_session |\n| 1 | 1 | 2019-07-20 | scroll_down |\n| 1 | 1 | 2019-07-20 | end_session |\n| 2 | 4 | 2019-07-20 | open_session |\n| 2 | 4 | 2019-07-21 | send_message |\n| 2 | 4 | 2019-07-21 | end_session |\n| 3 | 2 | 2019-07-21 | open_session |\n| 3 | 2 | 2019-07-21 | send_message |\n| 3 | 2 | 2019-07-21 | end_session |\n| 4 | 3 | 2019-06-25 | open_session |\n| 4 | 3 | 2019-06-25 | end_session |\n+---------+------------+---------------+---------------+\n<strong>Output:</strong> \n+------------+--------------+ \n| day | active_users |\n+------------+--------------+ \n| 2019-07-20 | 2 |\n| 2019-07-21 | 2 |\n+------------+--------------+ \n<strong>Explanation:</strong> Note that we do not care about days with zero active users.\n</pre>\n",