{"id":3994,"date":"2023-11-02T09:22:40","date_gmt":"2023-11-02T01:22:40","guid":{"rendered":"https:\/\/white-night.club\/?p=3994"},"modified":"2023-11-09T11:07:43","modified_gmt":"2023-11-09T03:07:43","slug":"ad120","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/02\/ad120\/","title":{"rendered":"1098.\u00a0\u5c0f\u4f17\u4e66\u7c4d"},"content":{"rendered":"\n<p>\u4e66\u7c4d\u8868&nbsp;<code>Books<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| book_id        | int     |\n| name           | varchar |\n| available_from | date    |\n+----------------+---------+\nbook_id \u662f\u8fd9\u4e2a\u8868\u7684\u4e3b\u952e\uff08\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\uff09\u3002\n<\/pre>\n\n\n\n<p>\u8ba2\u5355\u8868&nbsp;<code>Orders<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| order_id       | int     |\n| book_id        | int     |\n| quantity       | int     |\n| dispatch_date  | date    |\n+----------------+---------+\norder_id \u662f\u8fd9\u4e2a\u8868\u7684\u4e3b\u952e\uff08\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\uff09\u3002\nbook_id  \u662f Books \u8868\u7684\u5916\u952e\uff08reference \u5217\uff09\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u7b5b\u9009\u51fa\u8fc7\u53bb\u4e00\u5e74\u4e2d\u8ba2\u5355\u603b\u91cf&nbsp;<strong>\u5c11\u4e8e&nbsp;<\/strong><code>10<\/code><strong>&nbsp;\u672c&nbsp;<\/strong>\u7684&nbsp;<strong>\u4e66\u7c4d<\/strong>\uff0c\u5e76\u4e14&nbsp;<strong>\u4e0d\u8003\u8651&nbsp;<\/strong>\u4e0a\u67b6\u8ddd\u4eca\u9500\u552e&nbsp;<strong>\u4e0d\u6ee1\u4e00\u4e2a\u6708<\/strong>&nbsp;\u7684\u4e66\u7c4d<strong>&nbsp;<\/strong>\u3002<strong>\u5047\u8bbe\u4eca\u5929\u662f<\/strong>&nbsp;<code>2019-06-23<\/code>&nbsp;<strong>\u3002<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u8868&nbsp;<strong>\u65e0\u987a\u5e8f\u8981\u6c42<\/strong>&nbsp;\u3002<\/p>\n\n\n\n<p>\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nBooks \u8868\uff1a\n+---------+--------------------+----------------+\n| book_id | name               | available_from |\n+---------+--------------------+----------------+\n| 1       | \"Kalila And Demna\" | 2010-01-01     |\n| 2       | \"28 Letters\"       | 2012-05-12     |\n| 3       | \"The Hobbit\"       | 2019-06-10     |\n| 4       | \"13 Reasons Why\"   | 2019-06-01     |\n| 5       | \"The Hunger Games\" | 2008-09-21     |\n+---------+--------------------+----------------+\nOrders \u8868\uff1a\n+----------+---------+----------+---------------+\n| order_id | book_id | quantity | dispatch_date |\n+----------+---------+----------+---------------+\n| 1        | 1       | 2        | 2018-07-26    |\n| 2        | 1       | 1        | 2018-11-05    |\n| 3        | 3       | 8        | 2019-06-11    |\n| 4        | 4       | 6        | 2019-06-05    |\n| 5        | 4       | 5        | 2019-06-20    |\n| 6        | 5       | 9        | 2009-02-02    |\n| 7        | 5       | 8        | 2010-04-13    |\n+----------+---------+----------+---------------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+-----------+--------------------+\n| book_id   | name               |\n+-----------+--------------------+\n| 1         | \"Kalila And Demna\" |\n| 2         | \"28 Letters\"       |\n| 5         | \"The Hunger Games\" |\n+-----------+--------------------+<\/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>\u5de6\u8054\u7ed3<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4e00\u5f00\u59cb\u5de6\u8054\u7ed3\u4e86books\u8868\uff0c\u4f46\u662f\u60f3\u4e86\u60f3Orders\u4e2d\u7684\u6bcf\u4e2abook_id\u90fd\u80fd\u5728Books\u8868\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\uff0c\u53cd\u8fc7\u6765\u5c31\u4e0d\u4e00\u5b9a\u4e86\uff0c\u6709\u7684\u4e66\u53ef\u80fd\u6ca1\u5356\u51fa\u53bb\u8fc7\u3002<\/p>\n\n\n\n<p>\u8fd8\u6709quantitiy&#8230;\u4e00\u5f00\u59cb\u770b\u6210quality\uff0c\u641e\u5f97\u6211\u53bbSUM(order_id)\u53d1\u73b0\u600e\u4e48\u90fd\u505a\u4e0d\u5bf9&#8230;\u771f\u7684\u662f\u4f4e\u7ea7\u9519\u8bef\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT A.book_id,A.name\r\nFROM books AS A \r\nLEFT JOIN Orders AS B \r\nON A.book_id=B.book_id AND B.dispatch_date>'2018-06-23'\r\nWHERE A.available_from&lt;'2019-05-23'\r\nGROUP BY A.book_id\r\nHAVING SUM(B.quantity)&lt;10 OR SUM(B.quantity)IS NULL<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1aLEFT JOIN<\/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\/3994"}],"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=3994"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3994\/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=3994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}