{"id":2173,"date":"2023-10-09T15:47:44","date_gmt":"2023-10-09T07:47:44","guid":{"rendered":"https:\/\/white-night.club\/?p=2173"},"modified":"2023-11-09T11:07:51","modified_gmt":"2023-11-09T03:07:51","slug":"ad31","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/09\/ad31\/","title":{"rendered":"577.\u00a0\u5458\u5de5\u5956\u91d1"},"content":{"rendered":"\n<p>\u8868\uff1a<code>Employee<\/code>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| empId       | int     |\n| name        | varchar |\n| supervisor  | int     |\n| salary      | int     |\n+-------------+---------+\nempId \u662f\u8be5\u8868\u4e2d\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u90fd\u8868\u793a\u5458\u5de5\u7684\u59d3\u540d\u548c id\uff0c\u4ee5\u53ca\u4ed6\u4eec\u7684\u5de5\u8d44\u548c\u7ecf\u7406\u7684 id\u3002\n<\/pre>\n\n\n\n<p>\u8868\uff1a<code>Bonus<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| empId       | int  |\n| bonus       | int  |\n+-------------+------+\nempId \u662f\u8be5\u8868\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\u3002\nempId \u662f Employee \u8868\u4e2d empId \u7684\u5916\u952e(reference \u5217)\u3002\n\u8be5\u8868\u7684\u6bcf\u4e00\u884c\u90fd\u5305\u542b\u4e00\u4e2a\u5458\u5de5\u7684 id \u548c\u4ed6\u4eec\u5404\u81ea\u7684\u5956\u91d1\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c\u62a5\u544a\u6bcf\u4e2a\u5956\u91d1&nbsp;<strong>\u5c11\u4e8e<\/strong>&nbsp;<code>1000<\/code>&nbsp;\u7684\u5458\u5de5\u7684\u59d3\u540d\u548c\u5956\u91d1\u6570\u989d\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>\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>\nEmployee table:\n+-------+--------+------------+--------+\n| empId | name   | supervisor | salary |\n+-------+--------+------------+--------+\n| 3     | Brad   | null       | 4000   |\n| 1     | John   | 3          | 1000   |\n| 2     | Dan    | 3          | 2000   |\n| 4     | Thomas | 3          | 4000   |\n+-------+--------+------------+--------+\nBonus table:\n+-------+-------+\n| empId | bonus |\n+-------+-------+\n| 2     | 500   |\n| 4     | 2000  |\n+-------+-------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+------+-------+\n| name | bonus |\n+------+-------+\n| Brad | null  |\n| John | null  |\n| Dan  | 500   |\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>\u591a\u8868\u67e5\u8be2<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u591a\u8868\u67e5\u8be2\u3002\u4e3b\u8981\u662fis null\u7684\u7528\u6cd5\u3002\u4e0d\u5e26is null\uff0c\u6ca1\u6cd5\u6bd4\u8f83\u4e3a\u7a7a\u7684\u503c\u3002\u6700\u540e\u67e5\u8be2\u51fa\u6765\u7684\u7ed3\u679c\u5c31\u4e0d\u5e26\u7a7a\u503c\u3002\u6240\u4ee5\u7528\u201d=NULL\u201c\u4e5f\u4e0d\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\nSELECT A.name,B.bonus\nFROM Employee AS A\nLEFT JOIN Bonus AS B\nON A.empId=B.empId WHERE B.bonus is null or B.bonus&lt;1000<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u591a\u8868\u67e5\u8be2<\/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\/2173"}],"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=2173"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2173\/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=2173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}