{ "data": { "question": { "questionId": "3097", "questionFrontendId": "2837", "boundTopicId": null, "title": "Total Traveled Distance", "titleSlug": "total-traveled-distance", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 11, "dislikes": 2, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"name\"],\"Rides\":[\"ride_id\",\"user_id\",\"distance\"]},\"rows\":{\"Users\":[[17,\"Addison\"],[14,\"Ethan\"],[4,\"Michael\"],[2,\"Avery\"],[10,\"Eleanor\"]],\"Rides\":[[72,17,160],[42,14,161],[45,4,59],[32,2,197],[15,4,357],[56,2,196],[10,14,25]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"1.5K\", \"totalAcceptedRaw\": 1091, \"totalSubmissionRaw\": 1530, \"acRate\": \"71.3%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Users\":[\"user_id\",\"name\"],\"Rides\":[\"ride_id\",\"user_id\",\"distance\"]},\"rows\":{\"Users\":[[17,\"Addison\"],[14,\"Ethan\"],[4,\"Michael\"],[2,\"Avery\"],[10,\"Eleanor\"]],\"Rides\":[[72,17,160],[42,14,161],[45,4,59],[32,2,197],[15,4,357],[56,2,196],[10,14,25]]}}", "metaData": "{\"mysql\": [\"Create table if not exists Users(user_id int, name varchar(30))\", \"Create table if not exists Rides(ride_id int,user_id int, distance int)\"], \"mssql\": [\"Create table Users(user_id int, name varchar(30))\", \"Create table Rides(ride_id int,user_id int, distance int)\"], \"oraclesql\": [\"Create table Users(user_id int, name varchar(30))\", \"Create table Rides(ride_id int,user_id int, distance int)\"], \"database\": true, \"name\": \"get_total_distance\", \"pythondata\": [\"Users = pd.DataFrame([], columns=['user_id', 'name']).astype({'user_id':'Int64', 'name':'object'})\", \"Rides = pd.DataFrame([], columns=['ride_id', 'user_id', 'distance']).astype({'ride_id':'Int64', 'user_id':'Int64', 'distance':'Int64'})\"], \"postgresql\": [\"Create table if not exists Users(user_id int, name varchar(30))\", \"Create table if not exists Rides(ride_id int,user_id int, distance int)\"], \"database_schema\": {\"Users\": {\"user_id\": \"INT\", \"name\": \"VARCHAR(30)\"}, \"Rides\": {\"ride_id\": \"INT\", \"user_id\": \"INT\", \"distance\": \"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table if not exists Users(user_id int, name varchar(30))", "Create table if not exists Rides(ride_id int,user_id int, distance int)", "Truncate table Users", "insert into Users (user_id, name) values ('17', 'Addison')", "insert into Users (user_id, name) values ('14', 'Ethan')", "insert into Users (user_id, name) values ('4', 'Michael')", "insert into Users (user_id, name) values ('2', 'Avery')", "insert into Users (user_id, name) values ('10', 'Eleanor')", "Truncate table Rides", "insert into Rides (ride_id, user_id, distance) values ('72', '17', '160')", "insert into Rides (ride_id, user_id, distance) values ('42', '14', '161')", "insert into Rides (ride_id, user_id, distance) values ('45', '4', '59')", "insert into Rides (ride_id, user_id, distance) values ('32', '2', '197')", "insert into Rides (ride_id, user_id, distance) values ('15', '4', '357')", "insert into Rides (ride_id, user_id, distance) values ('56', '2', '196')", "insert into Rides (ride_id, user_id, distance) values ('10', '14', '25')" ], "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" } } }