mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -7,17 +7,17 @@
|
||||
"boundTopicId": 1073,
|
||||
"title": "Customers Who Never Order",
|
||||
"titleSlug": "customers-who-never-order",
|
||||
"content": "<p>Table: <code>Customers</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| name | varchar |\n+-------------+---------+\nid is the primary key column for this table.\nEach row of this table indicates the ID and name of a customer.\n</pre>\n\n<p> </p>\n\n<p>Table: <code>Orders</code></p>\n\n<pre>\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id | int |\n| customerId | int |\n+-------------+------+\nid is the primary key column for this table.\ncustomerId is a foreign key of the ID from the Customers table.\nEach row of this table indicates the ID of an order and the ID of the customer who ordered it.\n</pre>\n\n<p> </p>\n\n<p>Write an SQL query to report all customers who never order anything.</p>\n\n<p>Return the result table in <strong>any order</strong>.</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> \nCustomers table:\n+----+-------+\n| id | name |\n+----+-------+\n| 1 | Joe |\n| 2 | Henry |\n| 3 | Sam |\n| 4 | Max |\n+----+-------+\nOrders table:\n+----+------------+\n| id | customerId |\n+----+------------+\n| 1 | 3 |\n| 2 | 1 |\n+----+------------+\n<strong>Output:</strong> \n+-----------+\n| Customers |\n+-----------+\n| Henry |\n| Max |\n+-----------+\n</pre>\n",
|
||||
"content": "<p>Table: <code>Customers</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| name | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the ID and name of a customer.\n</pre>\n\n<p> </p>\n\n<p>Table: <code>Orders</code></p>\n\n<pre>\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id | int |\n| customerId | int |\n+-------------+------+\nid is the primary key (column with unique values) for this table.\ncustomerId is a foreign key (reference columns) of the ID from the Customers table.\nEach row of this table indicates the ID of an order and the ID of the customer who ordered it.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find all customers who never order anything.</p>\n\n<p>Return the result table in <strong>any order</strong>.</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> \nCustomers table:\n+----+-------+\n| id | name |\n+----+-------+\n| 1 | Joe |\n| 2 | Henry |\n| 3 | Sam |\n| 4 | Max |\n+----+-------+\nOrders table:\n+----+------------+\n| id | customerId |\n+----+------------+\n| 1 | 3 |\n| 2 | 1 |\n+----+------------+\n<strong>Output:</strong> \n+-----------+\n| Customers |\n+-----------+\n| Henry |\n| Max |\n+-----------+\n</pre>\n",
|
||||
"translatedTitle": "从不订购的客户",
|
||||
"translatedContent": "<p>某网站包含两个表,<code>Customers</code> 表和 <code>Orders</code> 表。编写一个 SQL 查询,找出所有从不订购任何东西的客户。</p>\n\n<p><code>Customers</code> 表:</p>\n\n<pre>+----+-------+\n| Id | Name |\n+----+-------+\n| 1 | Joe |\n| 2 | Henry |\n| 3 | Sam |\n| 4 | Max |\n+----+-------+\n</pre>\n\n<p><code>Orders</code> 表:</p>\n\n<pre>+----+------------+\n| Id | CustomerId |\n+----+------------+\n| 1 | 3 |\n| 2 | 1 |\n+----+------------+\n</pre>\n\n<p>例如给定上述表格,你的查询应返回:</p>\n\n<pre>+-----------+\n| Customers |\n+-----------+\n| Henry |\n| Max |\n+-----------+\n</pre>\n",
|
||||
"translatedContent": "<p><code>Customers</code> 表:</p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| name | varchar |\n+-------------+---------+\n在 SQL 中,id 是该表的主键。\n该表的每一行都表示客户的 ID 和名称。</pre>\n\n<p><code>Orders</code> 表:</p>\n\n<pre>\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id | int |\n| customerId | int |\n+-------------+------+\n在 SQL 中,id 是该表的主键。\ncustomerId 是 Customers 表中 ID 的外键( Pandas 中的连接键)。\n该表的每一行都表示订单的 ID 和订购该订单的客户的 ID。</pre>\n\n<p> </p>\n\n<p>找出所有从不点任何东西的顾客。</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<b>输入:</b>\nCustomers table:\n+----+-------+\n| id | name |\n+----+-------+\n| 1 | Joe |\n| 2 | Henry |\n| 3 | Sam |\n| 4 | Max |\n+----+-------+\nOrders table:\n+----+------------+\n| id | customerId |\n+----+------------+\n| 1 | 3 |\n| 2 | 1 |\n+----+------------+\n<b>输出:</b>\n+-----------+\n| Customers |\n+-----------+\n| Henry |\n| Max |\n+-----------+</pre>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 299,
|
||||
"likes": 481,
|
||||
"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,9 +45,21 @@
|
||||
"langSlug": "oraclesql",
|
||||
"code": "/* Write your PL/SQL query statement below */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "Pandas",
|
||||
"langSlug": "pythondata",
|
||||
"code": "import pandas as pd\n\ndef find_customers(customers: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:\n ",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "PostgreSQL",
|
||||
"langSlug": "postgresql",
|
||||
"code": "-- Write your PostgreSQL query statement below",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"195.3K\", \"totalSubmission\": \"290.9K\", \"totalAcceptedRaw\": 195326, \"totalSubmissionRaw\": 290923, \"acRate\": \"67.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"365.6K\", \"totalSubmission\": \"551.7K\", \"totalAcceptedRaw\": 365638, \"totalSubmissionRaw\": 551682, \"acRate\": \"66.3%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "94",
|
||||
@@ -55,8 +67,8 @@
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\": {\"Customers\": [\"Id\", \"Name\"], \"Orders\": [\"Id\", \"CustomerId\"]}, \"rows\": {\"Customers\": [[1, \"Joe\"], [2, \"Henry\"], [3, \"Sam\"], [4, \"Max\"]], \"Orders\": [[1, 3], [2, 1]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Customers (id int, name varchar(255))\",\n \"Create table If Not Exists Orders (id int, customerId int)\"\n ],\n \"mssql\": [\n \"Create table Customers (id int, name varchar(255))\",\n \"Create table Orders (id int, customerId int)\"\n ],\n \"oraclesql\": [\n \"Create table Customers (id int, name varchar(255))\",\n \"Create table Orders (id int, customerId int)\"\n ],\n \"database\": true\n}",
|
||||
"sampleTestCase": "{\"headers\": {\"Customers\": [\"id\", \"name\"], \"Orders\": [\"id\", \"customerId\"]}, \"rows\": {\"Customers\": [[1, \"Joe\"], [2, \"Henry\"], [3, \"Sam\"], [4, \"Max\"]], \"Orders\": [[1, 3], [2, 1]]}}",
|
||||
"metaData": "{\"mysql\":[\"Create table If Not Exists Customers (id int, name varchar(255))\",\"Create table If Not Exists Orders (id int, customerId int)\"],\"mssql\":[\"Create table Customers (id int, name varchar(255))\",\"Create table Orders (id int, customerId int)\"],\"oraclesql\":[\"Create table Customers (id int, name varchar(255))\",\"Create table Orders (id int, customerId int)\"],\"database\":true,\"name\":\"find_customers\",\"pythondata\":[\"Customers = pd.DataFrame([], columns=['id', 'name']).astype({'id':'Int64', 'name':'object'})\",\"Orders = pd.DataFrame([], columns=['id', 'customerId']).astype({'id':'Int64', 'customerId':'Int64'})\"],\"manual\":false,\"postgresql\":[\"Create table If Not Exists Customers (id int, name varchar(255))\",\"Create table If Not Exists Orders (id int, customerId int)\"],\"database_schema\":{\"Customers\":{\"id\":\"INT\",\"name\":\"VARCHAR(255)\"},\"Orders\":{\"id\":\"INT\",\"customerId\":\"INT\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
@@ -72,7 +84,7 @@
|
||||
"insert into Orders (id, customerId) values ('2', '1')"
|
||||
],
|
||||
"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