{ "data": { "question": { "questionId": "597", "questionFrontendId": "597", "boundTopicId": null, "title": "Friend Requests I: Overall Acceptance Rate", "titleSlug": "friend-requests-i-overall-acceptance-rate", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 297, "dislikes": 754, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"FriendRequest\":[\"sender_id\",\"send_to_id\",\"request_date\"],\"RequestAccepted\":[\"requester_id\",\"accepter_id\",\"accept_date\"]},\"rows\":{\"FriendRequest\":[[1,2,\"2016/06/01\"],[1,3,\"2016/06/01\"],[1,4,\"2016/06/01\"],[2,3,\"2016/06/02\"],[3,4,\"2016/06/09\"]],\"RequestAccepted\":[[1,2,\"2016/06/03\"],[1,3,\"2016/06/08\"],[2,3,\"2016/06/08\"],[3,4,\"2016/06/09\"],[3,4,\"2016/06/10\"]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"71.6K\", \"totalSubmission\": \"170.4K\", \"totalAcceptedRaw\": 71633, \"totalSubmissionRaw\": 170378, \"acRate\": \"42.0%\"}", "hints": [ "Still remember how to count the number of rows in a table?", "What is the keyword to filter the duplicated records in a table?" ], "solution": { "id": "161", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"headers\":{\"FriendRequest\":[\"sender_id\",\"send_to_id\",\"request_date\"],\"RequestAccepted\":[\"requester_id\",\"accepter_id\",\"accept_date\"]},\"rows\":{\"FriendRequest\":[[1,2,\"2016/06/01\"],[1,3,\"2016/06/01\"],[1,4,\"2016/06/01\"],[2,3,\"2016/06/02\"],[3,4,\"2016/06/09\"]],\"RequestAccepted\":[[1,2,\"2016/06/03\"],[1,3,\"2016/06/08\"],[2,3,\"2016/06/08\"],[3,4,\"2016/06/09\"],[3,4,\"2016/06/10\"]]}}", "metaData": "{\"mysql\": [\"Create table If Not Exists FriendRequest (sender_id int, send_to_id int, request_date date)\", \"Create table If Not Exists RequestAccepted (requester_id int, accepter_id int, accept_date date)\"], \"mssql\": [\"Create table FriendRequest (sender_id int, send_to_id int, request_date date)\", \"Create table RequestAccepted (requester_id int, accepter_id int, accept_date date)\"], \"oraclesql\": [\"Create table FriendRequest (sender_id int, send_to_id int, request_date date)\", \"Create table RequestAccepted (requester_id int, accepter_id int, accept_date date)\", \"Alter SESSION set NLS_DATE_FORMAT = 'YYYY/MM/DD'\"], \"database\": true, \"name\": \"acceptance_rate\", \"pythondata\": [\"FriendRequest = pd.DataFrame([], columns=['sender_id', 'send_to_id', 'request_date']).astype({'sender_id':'Int64', 'send_to_id':'Int64', 'request_date':'datetime64[ns]'})\", \"RequestAccepted = pd.DataFrame([], columns=['requester_id', 'accepter_id', 'accept_date']).astype({'requester_id':'Int64', 'accepter_id':'Int64', 'accept_date':'datetime64[ns]'})\"], \"postgresql\": [\"Create table If Not Exists FriendRequest (sender_id int, send_to_id int, request_date date)\", \"Create table If Not Exists RequestAccepted (requester_id int, accepter_id int, accept_date date)\"], \"database_schema\": {\"FriendRequest\": {\"sender_id\": \"INT\", \"send_to_id\": \"INT\", \"request_date\": \"DATE\"}, \"RequestAccepted\": {\"requester_id\": \"INT\", \"accepter_id\": \"INT\", \"accept_date\": \"DATE\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists FriendRequest (sender_id int, send_to_id int, request_date date)", "Create table If Not Exists RequestAccepted (requester_id int, accepter_id int, accept_date date)", "Truncate table FriendRequest", "insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '2', '2016/06/01')", "insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '3', '2016/06/01')", "insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '4', '2016/06/01')", "insert into FriendRequest (sender_id, send_to_id, request_date) values ('2', '3', '2016/06/02')", "insert into FriendRequest (sender_id, send_to_id, request_date) values ('3', '4', '2016/06/09')", "Truncate table RequestAccepted", "insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '2', '2016/06/03')", "insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '3', '2016/06/08')", "insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('2', '3', '2016/06/08')", "insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('3', '4', '2016/06/09')", "insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('3', '4', '2016/06/10')" ], "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" } } }