2022-03-27 18:27:43 +08:00
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"question": {
|
|
|
|
"questionId": "1785",
|
|
|
|
"questionFrontendId": "1645",
|
|
|
|
"boundTopicId": null,
|
|
|
|
"title": "Hopper Company Queries II",
|
|
|
|
"titleSlug": "hopper-company-queries-ii",
|
|
|
|
"content": null,
|
|
|
|
"translatedTitle": null,
|
|
|
|
"translatedContent": null,
|
|
|
|
"isPaidOnly": true,
|
|
|
|
"difficulty": "Hard",
|
2023-12-09 18:42:21 +08:00
|
|
|
"likes": 59,
|
|
|
|
"dislikes": 15,
|
2022-03-27 18:27:43 +08:00
|
|
|
"isLiked": null,
|
2022-05-02 23:44:12 +08:00
|
|
|
"similarQuestions": "[{\"title\": \"Trips and Users\", \"titleSlug\": \"trips-and-users\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Hopper Company Queries I\", \"titleSlug\": \"hopper-company-queries-i\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Hopper Company Queries III\", \"titleSlug\": \"hopper-company-queries-iii\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Number of Times a Driver Was a Passenger\", \"titleSlug\": \"number-of-times-a-driver-was-a-passenger\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
2022-03-27 18:27:43 +08:00
|
|
|
"exampleTestcases": "{\"headers\":{\"Drivers\":[\"driver_id\",\"join_date\"],\"Rides\":[\"ride_id\",\"user_id\",\"requested_at\"],\"AcceptedRides\":[\"ride_id\",\"driver_id\",\"ride_distance\",\"ride_duration\"]},\"rows\":{\"Drivers\":[[10,\"2019-12-10\"],[8,\"2020-1-13\"],[5,\"2020-2-16\"],[7,\"2020-3-8\"],[4,\"2020-5-17\"],[1,\"2020-10-24\"],[6,\"2021-1-5\"]],\"Rides\":[[6,75,\"2019-12-9\"],[1,54,\"2020-2-9\"],[10,63,\"2020-3-4\"],[19,39,\"2020-4-6\"],[3,41,\"2020-6-3\"],[13,52,\"2020-6-22\"],[7,69,\"2020-7-16\"],[17,70,\"2020-8-25\"],[20,81,\"2020-11-2\"],[5,57,\"2020-11-9\"],[2,42,\"2020-12-9\"],[11,68,\"2021-1-11\"],[15,32,\"2021-1-17\"],[12,11,\"2021-1-19\"],[14,18,\"2021-1-27\"]],\"AcceptedRides\":[[10,10,63,38],[13,10,73,96],[7,8,100,28],[17,7,119,68],[20,1,121,92],[5,7,42,101],[2,4,6,38],[11,8,37,43],[15,8,108,82],[12,8,38,34],[14,1,90,74]]}}",
|
|
|
|
"categoryTitle": "Database",
|
|
|
|
"contributors": [],
|
|
|
|
"topicTags": [
|
|
|
|
{
|
|
|
|
"name": "Database",
|
|
|
|
"slug": "database",
|
|
|
|
"translatedName": null,
|
|
|
|
"__typename": "TopicTagNode"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"companyTagStats": null,
|
|
|
|
"codeSnippets": null,
|
2023-12-09 18:42:21 +08:00
|
|
|
"stats": "{\"totalAccepted\": \"5.8K\", \"totalSubmission\": \"15K\", \"totalAcceptedRaw\": 5814, \"totalSubmissionRaw\": 15037, \"acRate\": \"38.7%\"}",
|
2022-03-27 18:27:43 +08:00
|
|
|
"hints": [],
|
|
|
|
"solution": null,
|
|
|
|
"status": null,
|
|
|
|
"sampleTestCase": "{\"headers\":{\"Drivers\":[\"driver_id\",\"join_date\"],\"Rides\":[\"ride_id\",\"user_id\",\"requested_at\"],\"AcceptedRides\":[\"ride_id\",\"driver_id\",\"ride_distance\",\"ride_duration\"]},\"rows\":{\"Drivers\":[[10,\"2019-12-10\"],[8,\"2020-1-13\"],[5,\"2020-2-16\"],[7,\"2020-3-8\"],[4,\"2020-5-17\"],[1,\"2020-10-24\"],[6,\"2021-1-5\"]],\"Rides\":[[6,75,\"2019-12-9\"],[1,54,\"2020-2-9\"],[10,63,\"2020-3-4\"],[19,39,\"2020-4-6\"],[3,41,\"2020-6-3\"],[13,52,\"2020-6-22\"],[7,69,\"2020-7-16\"],[17,70,\"2020-8-25\"],[20,81,\"2020-11-2\"],[5,57,\"2020-11-9\"],[2,42,\"2020-12-9\"],[11,68,\"2021-1-11\"],[15,32,\"2021-1-17\"],[12,11,\"2021-1-19\"],[14,18,\"2021-1-27\"]],\"AcceptedRides\":[[10,10,63,38],[13,10,73,96],[7,8,100,28],[17,7,119,68],[20,1,121,92],[5,7,42,101],[2,4,6,38],[11,8,37,43],[15,8,108,82],[12,8,38,34],[14,1,90,74]]}}",
|
2023-12-09 18:42:21 +08:00
|
|
|
"metaData": "{\"mysql\": [\"Create table If Not Exists Drivers (driver_id int, join_date date)\", \"Create table If Not Exists Rides (ride_id int, user_id int, requested_at date)\", \"Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int)\"], \"mssql\": [\"Create table Drivers (driver_id int, join_date date)\", \"Create table Rides (ride_id int, user_id int, requested_at date)\", \"Create table AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int)\"], \"oraclesql\": [\"Create table Drivers (driver_id int, join_date date)\", \"Create table Rides (ride_id int, user_id int, requested_at date)\", \"Create table AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int)\", \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"], \"database\": true, \"name\": \"hopper_company_queries\", \"pythondata\": [\"Drivers = pd.DataFrame([], columns=['driver_id', 'join_date']).astype({'driver_id':'Int64', 'join_date':'datetime64[ns]'})\", \"Rides = pd.DataFrame([], columns=['ride_id', 'user_id', 'requested_at']).astype({'ride_id':'Int64', 'user_id':'Int64', 'requested_at':'datetime64[ns]'})\", \"AcceptedRides = pd.DataFrame([], columns=['ride_id', 'driver_id', 'ride_distance', 'ride_duration']).astype({'ride_id':'Int64', 'driver_id':'Int64', 'ride_distance':'Int64', 'ride_duration':'Int64'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Drivers (driver_id int, join_date date)\\n\", \"Create table If Not Exists Rides (ride_id int, user_id int, requested_at date)\", \"Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int)\"], \"database_schema\": {\"Drivers\": {\"driver_id\": \"INT\", \"join_date\": \"DATE\"}, \"Rides\": {\"ride_id\": \"INT\", \"user_id\": \"INT\", \"requested_at\": \"DATE\"}, \"AcceptedRides\": {\"ride_id\": \"INT\", \"driver_id\": \"INT\", \"ride_distance\": \"INT\", \"ride_duration\": \"INT\"}}}",
|
2022-03-27 18:27:43 +08:00
|
|
|
"judgerAvailable": true,
|
|
|
|
"judgeType": "large",
|
|
|
|
"mysqlSchemas": [
|
|
|
|
"Create table If Not Exists Drivers (driver_id int, join_date date)",
|
|
|
|
"Create table If Not Exists Rides (ride_id int, user_id int, requested_at date)",
|
|
|
|
"Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int)",
|
|
|
|
"Truncate table Drivers",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('10', '2019-12-10')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('8', '2020-1-13')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('5', '2020-2-16')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('7', '2020-3-8')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('4', '2020-5-17')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('1', '2020-10-24')",
|
|
|
|
"insert into Drivers (driver_id, join_date) values ('6', '2021-1-5')",
|
|
|
|
"Truncate table Rides",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('6', '75', '2019-12-9')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('1', '54', '2020-2-9')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('10', '63', '2020-3-4')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('19', '39', '2020-4-6')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('3', '41', '2020-6-3')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('13', '52', '2020-6-22')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('7', '69', '2020-7-16')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('17', '70', '2020-8-25')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('20', '81', '2020-11-2')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('5', '57', '2020-11-9')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('2', '42', '2020-12-9')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('11', '68', '2021-1-11')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('15', '32', '2021-1-17')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('12', '11', '2021-1-19')",
|
|
|
|
"insert into Rides (ride_id, user_id, requested_at) values ('14', '18', '2021-1-27')",
|
|
|
|
"Truncate table AcceptedRides",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('10', '10', '63', '38')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('13', '10', '73', '96')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('7', '8', '100', '28')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('17', '7', '119', '68')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('20', '1', '121', '92')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('5', '7', '42', '101')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('2', '4', '6', '38')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('11', '8', '37', '43')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('15', '8', '108', '82')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('12', '8', '38', '34')",
|
|
|
|
"insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('14', '1', '90', '74')"
|
|
|
|
],
|
|
|
|
"enableRunCode": true,
|
|
|
|
"enableTestMode": false,
|
|
|
|
"enableDebugger": false,
|
2023-12-09 18:42:21 +08:00
|
|
|
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"], \"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"], \"postgresql\": [\"PostgreSQL\", \"<p>PostgreSQL 16</p>\"]}",
|
2022-03-27 18:27:43 +08:00
|
|
|
"libraryUrl": null,
|
|
|
|
"adminUrl": null,
|
|
|
|
"challengeQuestion": null,
|
|
|
|
"__typename": "QuestionNode"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|