1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-24 22:38:57 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>Table:&nbsp;<code>Product</code></p>\n\n<pre>\n+--------------+---------+\n| Column Name | Type |\n+--------------+---------+\n| product_id | int |\n| product_name | varchar |\n| unit_price | int |\n+--------------+---------+\nProduct_id是该表的主键。\n该表的每一行显示每个产品的名称和价格。\n</pre>\n\n<p>Table:&nbsp;<code>Sales</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| seller_id | int |\n| product_id | int |\n| buyer_id | int |\n| sale_date | date |\n| quantity | int |\n| price | int |\n+------ ------+---------+\n这个表没有主键它可以有重复的行。\nproduct_id 是 Product 表的外键。\n该表的每一行包含关于一个销售的一些信息。\n</pre>\n\n<p>&nbsp;</p>\n\n<p>编写一个SQL查询报告<code>2019年春季</code>才售出的产品。即<strong>仅</strong>在<code><strong>2019-01-01</strong></code>至<code><strong>2019-03-31</strong></code>(含)之间出售的商品。</p>\n\n<p>以 <strong>任意顺序</strong> 返回结果表。</p>\n\n<p>查询结果格式如下所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\nProduct table:\n+------------+--------------+------------+\n| product_id | product_name | unit_price |\n+------------+--------------+------------+\n| 1 | S8 | 1000 |\n| 2 | G4 | 800 |\n| 3 | iPhone | 1400 |\n+------------+--------------+------------+\n<code>Sales </code>table:\n+-----------+------------+----------+------------+----------+-------+\n| seller_id | product_id | buyer_id | sale_date | quantity | price |\n+-----------+------------+----------+------------+----------+-------+\n| 1 | 1 | 1 | 2019-01-21 | 2 | 2000 |\n| 1 | 2 | 2 | 2019-02-17 | 1 | 800 |\n| 2 | 2 | 3 | 2019-06-02 | 1 | 800 |\n| 3 | 3 | 4 | 2019-05-13 | 2 | 2800 |\n+-----------+------------+----------+------------+----------+-------+\n<strong>输出:</strong>\n+-------------+--------------+\n| product_id | product_name |\n+-------------+--------------+\n| 1 | S8 |\n+-------------+--------------+\n<strong>解释:</strong>\nid为1的产品仅在2019年春季销售。\nid为2的产品在2019年春季销售但也在2019年春季之后销售。\nid 3的产品在2019年春季之后销售。\n我们只退回产品1因为它是2019年春季才销售的产品。</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 41,
"likes": 46,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -47,7 +47,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"13.4K\", \"totalSubmission\": \"25.1K\", \"totalAcceptedRaw\": 13440, \"totalSubmissionRaw\": 25072, \"acRate\": \"53.6%\"}",
"stats": "{\"totalAccepted\": \"16.3K\", \"totalSubmission\": \"29.8K\", \"totalAcceptedRaw\": 16297, \"totalSubmissionRaw\": 29765, \"acRate\": \"54.8%\"}",
"hints": [],
"solution": null,
"status": null,