mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 22:38:57 +08:00
存量题库数据更新
This commit is contained in:
@@ -7,17 +7,17 @@
|
||||
"boundTopicId": 2642,
|
||||
"title": "Customer Placing the Largest Number of Orders",
|
||||
"titleSlug": "customer-placing-the-largest-number-of-orders",
|
||||
"content": "<p>Table: <code>Orders</code></p>\n\n<pre>\n+-----------------+----------+\n| Column Name | Type |\n+-----------------+----------+\n| order_number | int |\n| customer_number | int |\n+-----------------+----------+\norder_number is the primary key for this table.\nThis table contains information about the order ID and the customer ID.\n</pre>\n\n<p> </p>\n\n<p>Write an SQL query to find the <code>customer_number</code> for the customer who has placed <strong>the largest number of orders</strong>.</p>\n\n<p>The test cases are generated so that <strong>exactly one customer</strong> will have placed more orders than any other customer.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nOrders table:\n+--------------+-----------------+\n| order_number | customer_number |\n+--------------+-----------------+\n| 1 | 1 |\n| 2 | 2 |\n| 3 | 3 |\n| 4 | 3 |\n+--------------+-----------------+\n<strong>Output:</strong> \n+-----------------+\n| customer_number |\n+-----------------+\n| 3 |\n+-----------------+\n<strong>Explanation:</strong> \nThe customer with number 3 has two orders, which is greater than either customer 1 or 2 because each of them only has one order. \nSo the result is customer_number 3.\n</pre>\n\n<p> </p>\n<p><strong>Follow up:</strong> What if more than one customer has the largest number of orders, can you find all the <code>customer_number</code> in this case?</p>\n",
|
||||
"content": "<p>Table: <code>Orders</code></p>\n\n<pre>\n+-----------------+----------+\n| Column Name | Type |\n+-----------------+----------+\n| order_number | int |\n| customer_number | int |\n+-----------------+----------+\norder_number is the primary key (column with unique values) for this table.\nThis table contains information about the order ID and the customer ID.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find the <code>customer_number</code> for the customer who has placed <strong>the largest number of orders</strong>.</p>\n\n<p>The test cases are generated so that <strong>exactly one customer</strong> will have placed more orders than any other customer.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nOrders table:\n+--------------+-----------------+\n| order_number | customer_number |\n+--------------+-----------------+\n| 1 | 1 |\n| 2 | 2 |\n| 3 | 3 |\n| 4 | 3 |\n+--------------+-----------------+\n<strong>Output:</strong> \n+-----------------+\n| customer_number |\n+-----------------+\n| 3 |\n+-----------------+\n<strong>Explanation:</strong> \nThe customer with number 3 has two orders, which is greater than either customer 1 or 2 because each of them only has one order. \nSo the result is customer_number 3.\n</pre>\n\n<p> </p>\n<p><strong>Follow up:</strong> What if more than one customer has the largest number of orders, can you find all the <code>customer_number</code> in this case?</p>\n",
|
||||
"translatedTitle": "订单最多的客户",
|
||||
"translatedContent": "<p>表: <code>Orders</code></p>\n\n<pre>\n+-----------------+----------+\n| Column Name | Type |\n+-----------------+----------+\n| order_number | int |\n| customer_number | int |\n+-----------------+----------+\nOrder_number是该表的主键。\n此表包含关于订单ID和客户ID的信息。\n</pre>\n\n<p> </p>\n\n<p>编写一个SQL查询,为下了 <strong>最多订单</strong> 的客户查找 <code>customer_number</code> 。</p>\n\n<p>测试用例生成后, <strong>恰好有一个客户</strong> 比任何其他客户下了更多的订单。</p>\n\n<p>查询结果格式如下所示。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> \nOrders 表:\n+--------------+-----------------+\n| order_number | customer_number |\n+--------------+-----------------+\n| 1 | 1 |\n| 2 | 2 |\n| 3 | 3 |\n| 4 | 3 |\n+--------------+-----------------+\n<strong>输出:</strong> \n+-----------------+\n| customer_number |\n+-----------------+\n| 3 |\n+-----------------+\n<strong>解释:</strong> \ncustomer_number 为 '3' 的顾客有两个订单,比顾客 '1' 或者 '2' 都要多,因为他们只有一个订单。\n所以结果是该顾客的 customer_number ,也就是 3 。\n</pre>\n\n<p> </p>\n\n<p><strong>进阶:</strong> 如果有多位顾客订单数并列最多,你能找到他们所有的 <code>customer_number</code> 吗?</p>\n",
|
||||
"translatedContent": "<p>表: <code>Orders</code></p>\n\n<pre>\n+-----------------+----------+\n| Column Name | Type |\n+-----------------+----------+\n| order_number | int |\n| customer_number | int |\n+-----------------+----------+\n在 SQL 中,Order_number是该表的主键。\n此表包含关于订单ID和客户ID的信息。\n</pre>\n\n<p> </p>\n\n<p>查找下了 <strong>最多订单</strong> 的客户的 <code>customer_number</code> 。</p>\n\n<p>测试用例生成后, <strong>恰好有一个客户</strong> 比任何其他客户下了更多的订单。</p>\n\n<p>查询结果格式如下所示。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> \nOrders 表:\n+--------------+-----------------+\n| order_number | customer_number |\n+--------------+-----------------+\n| 1 | 1 |\n| 2 | 2 |\n| 3 | 3 |\n| 4 | 3 |\n+--------------+-----------------+\n<strong>输出:</strong> \n+-----------------+\n| customer_number |\n+-----------------+\n| 3 |\n+-----------------+\n<strong>解释:</strong> \ncustomer_number 为 '3' 的顾客有两个订单,比顾客 '1' 或者 '2' 都要多,因为他们只有一个订单。\n所以结果是该顾客的 customer_number ,也就是 3 。\n</pre>\n\n<p> </p>\n\n<p><strong>进阶:</strong> 如果有多位顾客订单数并列最多,你能找到他们所有的 <code>customer_number</code> 吗?</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 42,
|
||||
"likes": 156,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
@@ -45,16 +45,28 @@
|
||||
"langSlug": "oraclesql",
|
||||
"code": "/* Write your PL/SQL query statement below */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "Pandas",
|
||||
"langSlug": "pythondata",
|
||||
"code": "import pandas as pd\n\ndef largest_orders(orders: pd.DataFrame) -> pd.DataFrame:\n ",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "PostgreSQL",
|
||||
"langSlug": "postgresql",
|
||||
"code": "-- Write your PostgreSQL query statement below",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"24.9K\", \"totalSubmission\": \"33.9K\", \"totalAcceptedRaw\": 24887, \"totalSubmissionRaw\": 33914, \"acRate\": \"73.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"91K\", \"totalSubmission\": \"133.7K\", \"totalAcceptedRaw\": 90958, \"totalSubmissionRaw\": 133694, \"acRate\": \"68.0%\"}",
|
||||
"hints": [
|
||||
"MySQL uses a different expression to get the first records other than MSSQL's TOP expression."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"orders\":[\"order_number\",\"customer_number\"]},\"rows\":{\"orders\":[[1,1],[2,2],[3,3],[4,3]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists orders (order_number int, customer_number int)\"\n ],\n \"mssql\": [\n \"Create table orders (order_number int, customer_number int)\"\n ],\n \"oraclesql\": [\n \"Create table orders (order_number int, customer_number int)\"\n ],\n \"database\": true\n}",
|
||||
"metaData": "{\"mysql\":[\"Create table If Not Exists orders (order_number int, customer_number int)\"],\"mssql\":[\"Create table orders (order_number int, customer_number int)\"],\"oraclesql\":[\"Create table orders (order_number int, customer_number int)\"],\"database\":true,\"name\":\"largest_orders\",\"pythondata\":[\"orders = pd.DataFrame([], columns=['order_number', 'customer_number']).astype({'order_number':'Int64', 'customer_number':'Int64'})\"],\"postgresql\":[\"Create table If Not Exists orders (order_number int, customer_number int)\"],\"database_schema\":{\"orders\":{\"order_number\":\"INT\",\"customer_number\":\"INT\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
@@ -66,7 +78,7 @@
|
||||
"insert into orders (order_number, customer_number) values ('4', '3')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
|
||||
Reference in New Issue
Block a user