{ "data": { "question": { "questionId": "3156", "questionFrontendId": "2854", "boundTopicId": null, "title": "Rolling Average Steps", "titleSlug": "rolling-average-steps", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 10, "dislikes": 1, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\": {\"Steps\": [\"user_id\", \"steps_count\", \"steps_date\"]}, \"rows\": {\"Steps\": [[1,687,\"2021-09-02\"],[1,395,\"2021-09-04\"],[1,499,\"2021-09-05\"],[1,712,\"2021-09-06\"],[1,576,\"2021-09-07\"],[2,153,\"2021-09-06\"],[2,171,\"2021-09-07\"],[2,530,\"2021-09-08\"],[3,945,\"2021-09-04\"],[3,120,\"2021-09-07\"],[3,557,\"2021-09-08\"],[3,840,\"2021-09-09\"],[3,627,\"2021-09-10\"],[5,382,\"2021-09-05\"],[6,480,\"2021-09-01\"],[6,191,\"2021-09-02\"],[6,303,\"2021-09-05\"]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"726\", \"totalSubmission\": \"1.2K\", \"totalAcceptedRaw\": 726, \"totalSubmissionRaw\": 1197, \"acRate\": \"60.7%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\": {\"Steps\": [\"user_id\", \"steps_count\", \"steps_date\"]}, \"rows\": {\"Steps\": [[1,687,\"2021-09-02\"],[1,395,\"2021-09-04\"],[1,499,\"2021-09-05\"],[1,712,\"2021-09-06\"],[1,576,\"2021-09-07\"],[2,153,\"2021-09-06\"],[2,171,\"2021-09-07\"],[2,530,\"2021-09-08\"],[3,945,\"2021-09-04\"],[3,120,\"2021-09-07\"],[3,557,\"2021-09-08\"],[3,840,\"2021-09-09\"],[3,627,\"2021-09-10\"],[5,382,\"2021-09-05\"],[6,480,\"2021-09-01\"],[6,191,\"2021-09-02\"],[6,303,\"2021-09-05\"]]}}", "metaData": "{\"mysql\": [\"Create table if not exists Steps(user_id int, steps_count int, steps_date date)\"], \"mssql\": [\"Create table Steps(user_id int, steps_count int, steps_date date)\"], \"oraclesql\": [\"Create table Steps(user_id int, steps_count int, steps_date date)\", \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"], \"database\": true, \"name\": \"rolling_average\", \"pythondata\": [\"Steps = pd.DataFrame([], columns=['user_id', 'steps_count', 'steps_date']).astype({'user_id':'Int64', 'steps_count':'Int64', 'steps_date':'datetime64[ns]'})\"], \"postgresql\": [\"Create table if not exists Steps(user_id int, steps_count int, steps_date date)\"], \"database_schema\": {\"Steps\": {\"user_id\": \"INT\", \"steps_count\": \"INT\", \"steps_date\": \"DATE\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table if not exists Steps(user_id int, steps_count int, steps_date date)", "Truncate table Steps", "insert into Steps (user_id, steps_count, steps_date) values ('1', '687', '2021-09-02')", "insert into Steps (user_id, steps_count, steps_date) values ('1', '395', '2021-09-04')", "insert into Steps (user_id, steps_count, steps_date) values ('1', '499', '2021-09-05')", "insert into Steps (user_id, steps_count, steps_date) values ('1', '712', '2021-09-06')", "insert into Steps (user_id, steps_count, steps_date) values ('1', '576', '2021-09-07')", "insert into Steps (user_id, steps_count, steps_date) values ('2', '153', '2021-09-06')", "insert into Steps (user_id, steps_count, steps_date) values ('2', '171', '2021-09-07')", "insert into Steps (user_id, steps_count, steps_date) values ('2', '530', '2021-09-08')", "insert into Steps (user_id, steps_count, steps_date) values ('3', '945', '2021-09-04')", "insert into Steps (user_id, steps_count, steps_date) values ('3', '120', '2021-09-07')", "insert into Steps (user_id, steps_count, steps_date) values ('3', '557', '2021-09-08')", "insert into Steps (user_id, steps_count, steps_date) values ('3', '840', '2021-09-09')", "insert into Steps (user_id, steps_count, steps_date) values ('3', '627', '2021-09-10')", "insert into Steps (user_id, steps_count, steps_date) values ('5', '382', '2021-09-05')", "insert into Steps (user_id, steps_count, steps_date) values ('6', '480', '2021-09-01')", "insert into Steps (user_id, steps_count, steps_date) values ('6', '191', '2021-09-02')", "insert into Steps (user_id, steps_count, steps_date) values ('6', '303', '2021-09-05')" ], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"
MySQL 8.0
.
mssql server 2019
.
Oracle Sql 11.2
.
Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0
\"], \"postgresql\": [\"PostgreSQL\", \"PostgreSQL 16
\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }