{"id":3207,"date":"2023-10-22T11:03:13","date_gmt":"2023-10-22T03:03:13","guid":{"rendered":"https:\/\/white-night.club\/?p=3207"},"modified":"2024-03-24T19:57:58","modified_gmt":"2024-03-24T11:57:58","slug":"ad83","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/22\/ad83\/","title":{"rendered":"1495.\u00a0\u4e0a\u6708\u64ad\u653e\u7684\u513f\u7ae5\u9002\u5b9c\u7535\u5f71"},"content":{"rendered":"\n<p>\u8868:&nbsp;<code>TVProgram<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| program_date  | date    |\n| content_id    | int     |\n| channel       | varchar |\n+---------------+---------+\n(program_date, content_id) \u662f\u8be5\u8868\u7684\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\u7684\u7ec4\u5408)\u3002\n\u8be5\u8868\u5305\u542b\u7535\u89c6\u4e0a\u7684\u8282\u76ee\u4fe1\u606f\u3002\ncontent_id \u662f\u7535\u89c6\u4e00\u4e9b\u9891\u9053\u4e0a\u7684\u8282\u76ee\u7684 id\u3002<\/pre>\n\n\n\n<p>\u8868:&nbsp;<code>Content<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+------------------+---------+\n| Column Name      | Type    |\n+------------------+---------+\n| content_id       | varchar |\n| title            | varchar |\n| Kids_content     | enum    |\n| content_type     | varchar |\n+------------------+---------+\ncontent_id \u662f\u8be5\u8868\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217)\u3002\nKids_content \u662f\u679a\u4e3e\u7c7b\u578b, \u53d6\u503c\u4e3a('Y', 'N'), \u5176\u4e2d: \n'Y' \u8868\u793a\u513f\u7ae5\u9002\u5b9c\u5185\u5bb9, \u800c'N'\u8868\u793a\u513f\u7ae5\u4e0d\u5b9c\u5185\u5bb9\u3002\ncontent_type&nbsp;\u8868\u793a\u5185\u5bb9\u7684\u7c7b\u578b, \u6bd4\u5982\u7535\u5f71, \u7535\u89c6\u5267\u7b49\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\uff0c&nbsp;\u62a5\u544a\u5728 2020 \u5e74 6 \u6708\u4efd\u64ad\u653e\u7684\u513f\u7ae5\u9002\u5b9c\u7535\u5f71\u7684\u53bb\u91cd\u7535\u5f71\u540d.<\/p>\n\n\n\n<p>\u8fd4\u56de\u7684\u7ed3\u679c\u8868\u5355&nbsp;<strong>\u6ca1\u6709\u987a\u5e8f\u8981\u6c42<\/strong>&nbsp;.<\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u7684\u683c\u5f0f\u5982\u4e0b\u4f8b\u6240\u793a.<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>\u8f93\u5165\uff1a<\/strong>\nTVProgram<\/code> \u8868:\n+--------------------+--------------+-------------+\n| program_date       | content_id   | channel     |\n+--------------------+--------------+-------------+\n| 2020-06-10 08:00   | 1            | LC-Channel  |\n| 2020-05-11 12:00   | 2            | LC-Channel  |\n| 2020-05-12 12:00   | 3            | LC-Channel  |\n| 2020-05-13 14:00   | 4            | Disney Ch   |\n| 2020-06-18 14:00   | 4            | Disney Ch   |\n| 2020-07-15 16:00   | 5            | Disney Ch   |\n+--------------------+--------------+-------------+\n<code>Content<\/code> \u8868:\n+------------+----------------+---------------+---------------+\n| content_id | title          | Kids_content  | content_type  |\n+------------+----------------+---------------+---------------+\n| 1          | Leetcode Movie | N             | Movies        |\n| 2          | Alg. for Kids  | Y             | Series        |\n| 3          | Database Sols  | N             | Series        |\n| 4          | Aladdin        | Y             | Movies        |\n| 5          | Cinderella     | Y             | Movies        |\n+------------+----------------+---------------+---------------+\n<code><strong>\u8f93\u51fa\uff1a<\/strong><\/code>\n+--------------+\n| title        |\n+--------------+\n| Aladdin      |\n+--------------+\n<code><strong>\u89e3\u91ca\uff1a<\/strong><\/code>\n\"Leetcode Movie\" \u662f\u513f\u7ae5\u4e0d\u5b9c\u7684\u7535\u5f71.\n\"Alg. for Kids\" \u4e0d\u662f\u7535\u5f71.\n\"Database Sols\" \u4e0d\u662f\u7535\u5f71\n\"Aladin\" \u662f\u7535\u5f71, \u513f\u7ae5\u9002\u5b9c, \u5e76\u4e14\u5728 2020 \u5e74 6 \u6708\u4efd\u64ad\u653e.\n\"Cinderella\" \u4e0d\u5728 2020 \u5e74 6 \u6708\u4efd\u64ad\u653e.<\/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>\u6478\u9c7c<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4eca\u5929\u5468\u65e5\uff0c\u5199\u51e0\u9053\u7b80\u5355\u9898\u7136\u540e\u6478\u9c7c\u53bb\u4e86\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">SQL<\/span><span role=\"button\" tabindex=\"0\" data-code=\"# Write your MySQL query statement below\nSELECT DISTINCT A.title\nFROM Content AS A,TVProgram AS B\nWHERE A.content_id=B.content_id AND kids_content='Y' AND content_type='Movies' \nAND YEAR(program_date)=2020 AND MONTH(program_date)=6\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\"># Write your MySQL query <\/span><span style=\"color: #569CD6\">statement<\/span><span style=\"color: #D4D4D4\"> below<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">SELECT DISTINCT<\/span><span style=\"color: #D4D4D4\"> A.title<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">FROM<\/span><span style=\"color: #D4D4D4\"> Content <\/span><span style=\"color: #569CD6\">AS<\/span><span style=\"color: #D4D4D4\"> A,TVProgram <\/span><span style=\"color: #569CD6\">AS<\/span><span style=\"color: #D4D4D4\"> B<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">WHERE<\/span><span style=\"color: #D4D4D4\"> A.content_id=B.content_id <\/span><span style=\"color: #569CD6\">AND<\/span><span style=\"color: #D4D4D4\"> kids_content=<\/span><span style=\"color: #CE9178\">&#39;Y&#39;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">AND<\/span><span style=\"color: #D4D4D4\"> content_type=<\/span><span style=\"color: #CE9178\">&#39;Movies&#39;<\/span><span style=\"color: #D4D4D4\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">AND<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">YEAR<\/span><span style=\"color: #D4D4D4\">(program_date)=<\/span><span style=\"color: #B5CEA8\">2020<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">AND<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">MONTH<\/span><span style=\"color: #D4D4D4\">(program_date)=<\/span><span style=\"color: #B5CEA8\">6<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u6478\u9c7cSQL\u9898<\/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\/3207"}],"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=3207"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3207\/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=3207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}