{ "data": { "question": { "questionId": "1225", "questionFrontendId": "1126", "boundTopicId": null, "title": "Active Businesses", "titleSlug": "active-businesses", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 263, "dislikes": 28, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"Events\":[\"business_id\",\"event_type\",\"occurences\"]},\"rows\":{\"Events\":[[1,\"reviews\",7],[3,\"reviews\",3],[1,\"ads\",11],[2,\"ads\",7],[3,\"ads\",6],[1,\"page views\",3],[2,\"page views\",12]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"42.3K\", \"totalSubmission\": \"64.3K\", \"totalAcceptedRaw\": 42277, \"totalSubmissionRaw\": 64259, \"acRate\": \"65.8%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Events\":[\"business_id\",\"event_type\",\"occurences\"]},\"rows\":{\"Events\":[[1,\"reviews\",7],[3,\"reviews\",3],[1,\"ads\",11],[2,\"ads\",7],[3,\"ads\",6],[1,\"page views\",3],[2,\"page views\",12]]}}", "metaData": "{\"mysql\": [\"Create table If Not Exists Events (business_id int, event_type varchar(10), occurences int)\"], \"mssql\": [\"Create table Events (business_id int, event_type varchar(10), occurences int)\"], \"oraclesql\": [\"Create table Events (business_id int, event_type varchar(10), occurences int)\"], \"database\": true, \"name\": \"active_businesses\", \"pythondata\": [\"Events = pd.DataFrame([], columns=['business_id', 'event_type', 'occurences']).astype({'business_id':'Int64', 'event_type':'object', 'occurences':'Int64'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Events (business_id int, event_type varchar(10), occurences int)\"], \"database_schema\": {\"Events\": {\"business_id\": \"INT\", \"event_type\": \"VARCHAR(10)\", \"occurences\": \"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Events (business_id int, event_type varchar(10), occurences int)", "Truncate table Events", "insert into Events (business_id, event_type, occurences) values ('1', 'reviews', '7')", "insert into Events (business_id, event_type, occurences) values ('3', 'reviews', '3')", "insert into Events (business_id, event_type, occurences) values ('1', 'ads', '11')", "insert into Events (business_id, event_type, occurences) values ('2', 'ads', '7')", "insert into Events (business_id, event_type, occurences) values ('3', 'ads', '6')", "insert into Events (business_id, event_type, occurences) values ('1', 'page views', '3')", "insert into Events (business_id, event_type, occurences) values ('2', 'page views', '12')" ], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"

MySQL 8.0.

\"], \"mssql\": [\"MS SQL Server\", \"

mssql server 2019.

\"], \"oraclesql\": [\"Oracle\", \"

Oracle Sql 11.2.

\"], \"pythondata\": [\"Pandas\", \"

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" } } }