{"id":3763,"date":"2023-10-30T14:46:57","date_gmt":"2023-10-30T06:46:57","guid":{"rendered":"https:\/\/white-night.club\/?p=3763"},"modified":"2023-11-09T11:07:45","modified_gmt":"2023-11-09T03:07:45","slug":"ad111","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/30\/ad111\/","title":{"rendered":"1082.\u00a0\u9500\u552e\u5206\u6790 I"},"content":{"rendered":"\n<p>\u4ea7\u54c1\u8868\uff1a<code>Product<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| product_id   | int     |\n| product_name | varchar |\n| unit_price   | int     |\n+--------------+---------+\nproduct_id \u662f\u8fd9\u4e2a\u8868\u7684\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217)\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u663e\u793a\u6bcf\u4e2a\u4ea7\u54c1\u7684\u540d\u79f0\u548c\u4ef7\u683c\u3002\n<\/pre>\n\n\n\n<p>\u9500\u552e\u8868\uff1a<code>Sales<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+---------+\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\u8fd9\u4e2a\u8868\u5b83\u53ef\u4ee5\u6709\u91cd\u590d\u7684\u884c\u3002 \nproduct_id \u662f Product \u8868\u7684\u5916\u952e(reference \u5217)\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u5305\u542b\u5173\u4e8e\u4e00\u4e2a\u9500\u552e\u7684\u4e00\u4e9b\u4fe1\u606f\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u627e\u51fa\u603b\u9500\u552e\u989d\u6700\u9ad8\u7684\u9500\u552e\u8005\uff0c\u5982\u679c\u6709\u5e76\u5217\u7684\uff0c\u5c31\u90fd\u5c55\u793a\u51fa\u6765\u3002<\/p>\n\n\n\n<p>\u4ee5&nbsp;<strong>\u4efb\u610f\u987a\u5e8f<\/strong>&nbsp;\u8fd4\u56de\u7ed3\u679c\u8868\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nProduct \u8868\uff1a\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>\u8868\uff1a\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>\u8f93\u51fa\uff1a<\/strong>\n+-------------+\n| seller_id   |\n+-------------+\n| 1           |\n| 3           |\n+-------------+\n<strong>\u89e3\u91ca\uff1a<\/strong>Id \u4e3a 1 \u548c 3 \u7684\u9500\u552e\u8005\uff0c\u9500\u552e\u603b\u91d1\u989d\u90fd\u4e3a\u6700\u9ad8\u7684 2800\u3002<\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>ALL<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u6700\u8fd1\u5728\u770bANY\/ALL\u7684\u7528\u6cd5\uff0c\u6240\u4ee5\u62ff\u8fd9\u9898\u7ec3\u7ec3\u3002\u5176\u5b9e\u8fd8\u662fEXISTS\u90a3\u5957\u9010\u6761\u5339\u914d\u7684\u601d\u8def\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT seller_id\r\nFROM Sales\r\nGROUP BY seller_id\r\nHAVING SUM(price)>=ALL(\r\n    SELECT SUM(price)\r\n    FROM Sales\r\n    GROUP BY seller_id\r\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aALL<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3763"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=3763"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3763\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=3763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}