{ "data": { "question": { "questionId": "1862", "questionFrontendId": "1715", "categoryTitle": "Database", "boundTopicId": 558351, "title": "Count Apples and Oranges", "titleSlug": "count-apples-and-oranges", "content": null, "translatedTitle": "苹果和橘子的个数", "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 11, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [ { "name": "Database", "slug": "database", "translatedName": "数据库", "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"6.2K\", \"totalAcceptedRaw\": 4475, \"totalSubmissionRaw\": 6226, \"acRate\": \"71.9%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Boxes\":[\"box_id\",\"chest_id\",\"apple_count\",\"orange_count\"],\"Chests\":[\"chest_id\",\"apple_count\",\"orange_count\"]},\"rows\":{\"Boxes\":[[2,null,6,15],[18,14,4,15],[19,3,8,4],[12,2,19,20],[20,6,12,9],[8,6,9,9],[3,14,16,7]],\"Chests\":[[6,5,6],[14,20,10],[2,8,8],[3,19,4],[16,19,19]]}}", "metaData": "{\"mysql\":[\"Create table If Not Exists Boxes (box_id int, chest_id int, apple_count int, orange_count int)\",\"Create table If Not Exists Chests (chest_id int, apple_count int, orange_count int)\"],\"mssql\":[\"Create table Boxes (box_id int, chest_id int, apple_count int, orange_count int)\",\"Create table Chests (chest_id int, apple_count int, orange_count int)\"],\"oraclesql\":[\"Create table Boxes (box_id int, chest_id int, apple_count int, orange_count int)\",\"Create table Chests (chest_id int, apple_count int, orange_count int)\"],\"database\":true,\"name\":\"count_apples_and_oranges\",\"pythondata\":[\"Boxes = pd.DataFrame([], columns=['box_id', 'chest_id', 'apple_count', 'orange_count']).astype({'box_id':'Int64', 'chest_id':'Int64', 'apple_count':'Int64', 'orange_count':'Int64'})\",\"Chests = pd.DataFrame([], columns=['chest_id', 'apple_count', 'orange_count']).astype({'chest_id':'Int64', 'apple_count':'Int64', 'orange_count':'Int64'})\"],\"postgresql\":[\"\\nCreate table If Not Exists Boxes (box_id int, chest_id int, apple_count int, orange_count int)\\n\",\"Create table If Not Exists Chests (chest_id int, apple_count int, orange_count int)\"],\"database_schema\":{\"Boxes\":{\"box_id\":\"INT\",\"chest_id\":\"INT\",\"apple_count\":\"INT\",\"orange_count\":\"INT\"},\"Chests\":{\"chest_id\":\"INT\",\"apple_count\":\"INT\",\"orange_count\":\"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Boxes (box_id int, chest_id int, apple_count int, orange_count int)", "Create table If Not Exists Chests (chest_id int, apple_count int, orange_count int)", "Truncate table Boxes", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('2', 'None', '6', '15')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('18', '14', '4', '15')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('19', '3', '8', '4')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('12', '2', '19', '20')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('20', '6', '12', '9')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('8', '6', '9', '9')", "insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('3', '14', '16', '7')", "Truncate table Chests", "insert into Chests (chest_id, apple_count, orange_count) values ('6', '5', '6')", "insert into Chests (chest_id, apple_count, orange_count) values ('14', '20', '10')", "insert into Chests (chest_id, apple_count, orange_count) values ('2', '8', '8')", "insert into Chests (chest_id, apple_count, orange_count) values ('3', '19', '4')", "insert into Chests (chest_id, apple_count, orange_count) values ('16', '19', '19')" ], "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\":{\"Boxes\":[\"box_id\",\"chest_id\",\"apple_count\",\"orange_count\"],\"Chests\":[\"chest_id\",\"apple_count\",\"orange_count\"]},\"rows\":{\"Boxes\":[[2,null,6,15],[18,14,4,15],[19,3,8,4],[12,2,19,20],[20,6,12,9],[8,6,9,9],[3,14,16,7]],\"Chests\":[[6,5,6],[14,20,10],[2,8,8],[3,19,4],[16,19,19]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"