{ "data": { "question": { "questionId": "3340", "questionFrontendId": "100239", "categoryTitle": "Database", "boundTopicId": 2653966, "title": "Snaps Analysis", "titleSlug": "snaps-analysis", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 0, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"20\", \"totalSubmission\": \"47\", \"totalAcceptedRaw\": 20, \"totalSubmissionRaw\": 47, \"acRate\": \"42.6%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Activities\":[\"activity_id\",\"user_id\",\"activity_type\",\"time_spent\"],\"Age\":[\"user_id\",\"age_bucket\"]},\"rows\":{\"Activities\":[[7274,123,\"open\",4.50],[2425,123,\"send\",3.50],[1413,456,\"send\",5.67],[2536,456,\"open\",3.00],[8564,456,\"send\",8.24],[5235,789,\"send\",6.24],[4251,123,\"open\",1.25],[1435,789,\"open\",5.25]],\"Age\":[[123,\"31-35\"],[789,\"21-25\"],[456,\"26-30\"]]}}", "metaData": "{\"mysql\":[\"Create table if Not Exists Activities(activity_id int, user_id int, activity_type ENUM('send', 'open'), time_spent decimal(5,2))\",\"Create table if not Exists Age( user_id int, age_bucket ENUM('21-25','26-30','31-35'))\"],\"mssql\":[\"Create table Activities (activity_id int, user_id int, activity_type varchar(30) NOT NULL CHECK (activity_type IN ('send','open')), time_spent decimal(5,2))\",\"Create table Age( user_id int, age_bucket varchar(30) NOT NULL CHECK ( age_bucket IN ('21-25','26-30','31-35')))\"],\"oraclesql\":[\"Create table Activities (activity_id int, user_id int, activity_type varchar(30) NOT NULL CHECK (activity_type IN ('send','open')), time_spent decimal(5,2))\",\"Create table Age( user_id int, age_bucket varchar(30) NOT NULL CHECK ( age_bucket IN ('21-25','26-30','31-35')))\"],\"database\":true,\"name\":\"snap_analysis\",\"pythondata\":[\"Activities = pd.DataFrame([], columns=['activity_id', 'user_id', 'activity_type', 'time_spent']).astype({'activity_id':'Int64', 'user_id':'Int64', 'activity_type':'object', 'time_spent':'Float64'})\\n\",\"Age = pd.DataFrame([], columns=['user_id', 'age_bucket']).astype({'user_id':'Int64', 'age_bucket':'object'})\\n\"],\"postgresql\":[\"CREATE TABLE Activities (\\n activity_id SERIAL PRIMARY KEY,\\n user_id INT,\\n activity_type VARCHAR(30) NOT NULL CHECK (activity_type IN ('send', 'open')),\\n time_spent DECIMAL(5,2)\\n);\",\"CREATE TABLE Age (\\n user_id INT,\\n age_bucket VARCHAR(30) NOT NULL CHECK (age_bucket IN ('21-25', '26-30', '31-35'))\\n);\"],\"database_schema\":{\"Activities\":{\"activity_id\":\"INT\",\"user_id\":\"INT\",\"activity_type\":\"ENUM('send', 'open')\",\"time_spent\":\"DECIMAL(5, 2)\"},\"Age\":{\"user_id\":\"INT\",\"age_bucket\":\"ENUM('21-25', '26-30', '31-35')\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table if Not Exists Activities(activity_id int, user_id int, activity_type ENUM('send', 'open'), time_spent decimal(5,2))", "Create table if not Exists Age( user_id int, age_bucket ENUM('21-25','26-30','31-35'))", "Truncate table Activities", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('7274', '123', 'open', '4.5')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('2425', '123', 'send', '3.5')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('1413', '456', 'send', '5.67')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('2536', '456', 'open', '3.0')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('8564', '456', 'send', '8.24')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('5235', '789', 'send', '6.24')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('4251', '123', 'open', '1.25')", "insert into Activities (activity_id, user_id, activity_type, time_spent) values ('1435', '789', 'open', '5.25')", "Truncate table Age", "insert into Age (user_id, age_bucket) values ('123', '31-35')", "insert into Age (user_id, age_bucket) values ('789', '21-25')", "insert into Age (user_id, age_bucket) values ('456', '26-30')" ], "enableRunCode": true, "envInfo": "{\"mysql\":[\"MySQL\",\"
\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\" Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\" PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Activities\":[\"activity_id\",\"user_id\",\"activity_type\",\"time_spent\"],\"Age\":[\"user_id\",\"age_bucket\"]},\"rows\":{\"Activities\":[[7274,123,\"open\",4.50],[2425,123,\"send\",3.50],[1413,456,\"send\",5.67],[2536,456,\"open\",3.00],[8564,456,\"send\",8.24],[5235,789,\"send\",6.24],[4251,123,\"open\",1.25],[1435,789,\"open\",5.25]],\"Age\":[[123,\"31-35\"],[789,\"21-25\"],[456,\"26-30\"]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"