# SQL - Joins (Data Analytics) > INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, CROSS JOIN, self join, การ join หลายตาราง - 20 คำถามสัมภาษณ์ - Junior - [คำถามสัมภาษณ์: Data Analytics](https://sharpskill.dev/th/technologies/data-analytics/interview-questions.md) ## 1. การ join ประเภทใดที่คืนค่าเฉพาะแถวที่มีการจับคู่ในทั้งสองตาราง? **คำตอบ** INNER JOIN จะคืนค่าเฉพาะแถวที่เงื่อนไขการ join เป็นจริงในทั้งสองตาราง แถวที่ไม่มีการจับคู่ในตารางใดตารางหนึ่งจะถูกตัดออกจากผลลัพธ์ เป็นประเภทการ join ที่ใช้บ่อยที่สุดใน SQL เพราะรับประกันว่าทุกแถวในผลลัพธ์มีข้อมูลครบถ้วนจากทั้งสองตาราง ## 2. ใช้คีย์เวิร์ดใดเพื่อระบุเงื่อนไขการจับคู่ระหว่างสองตารางใน join? **คำตอบ** คีย์เวิร์ด ON กำหนดเงื่อนไขการจับคู่ระหว่างคอลัมน์ของทั้งสองตารางในระหว่างการ join ไวยากรณ์มาตรฐานคือ SELECT ... FROM table1 JOIN table2 ON table1.column = table2.column สามารถใช้ USING ได้เมื่อคอลัมน์ join มีชื่อเดียวกันในทั้งสองตาราง แต่ ON ยังคงเป็นรูปแบบที่ยืดหยุ่นและเป็นสากลที่สุด ## 3. LEFT JOIN คืนค่าอะไรเมื่อแถวจากตารางด้านซ้ายไม่มีการจับคู่ในตารางด้านขวา? **คำตอบ** LEFT JOIN เก็บแถวทั้งหมดจากตารางด้านซ้ายไม่ว่าจะมีการจับคู่ในตารางด้านขวาหรือไม่ เมื่อไม่มีการจับคู่ คอลัมน์จากตารางด้านขวาจะถูกเติมด้วยค่า NULL พฤติกรรมนี้มีประโยชน์อย่างมากในการระบุระเบียนที่ไม่มีคู่ หรือเพื่อให้แน่ใจว่าไม่มีข้อมูลใดจากตารางหลักหายไปในระหว่างการ join ## มีอีก 17 คำถาม - ความแตกต่างหลักระหว่าง LEFT JOIN และ RIGHT JOIN คืออะไร? - CROSS JOIN ให้ผลลัพธ์อย่างไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Data Analytics อื่นๆ - [Google Sheets - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-basics.md): 20 คำถาม, Junior - [Google Sheets - สูตรขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-advanced.md): 20 คำถาม, Junior - [SQL - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-basics.md): 25 คำถาม, Junior - [SQL - การรวมและการจัดกลุ่ม](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-aggregations.md): 20 คำถาม, Junior - [BigQuery - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/bigquery-fundamentals.md): 20 คำถาม, Junior - [Data Cleaning - การทำความสะอาดข้อมูล](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-cleaning.md): 20 คำถาม, Junior - [KPI และเมตริกทางธุรกิจ](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/kpis-metrics.md): 20 คำถาม, Junior - [สถิติเชิงพรรณนา](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/descriptive-statistics.md): 20 คำถาม, Junior - [Zapier และระบบอัตโนมัติ No-Code](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/zapier-automation.md): 20 คำถาม, Junior - [หลักการ Data Visualization](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-viz-principles.md): 20 คำถาม, Junior - [Python & Pandas - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/python-pandas-basics.md): 20 คำถาม, Junior - [Google Sheets - แดชบอร์ดอัตโนมัติ](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-dashboards.md): 20 คำถาม, Mid-Level - [SQL - Subquery และ CTE](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-subqueries-ctes.md): 20 คำถาม, Mid-Level - [SQL - Window Functions](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-window-functions.md): 20 คำถาม, Mid-Level - [BigQuery - ฟีเจอร์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/bigquery-advanced.md): 20 คำถาม, Mid-Level - [Data Modeling](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-modeling.md): 20 คำถาม, Mid-Level - [การวิเคราะห์ Funnel และ Conversion](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/funnel-analysis.md): 20 คำถาม, Mid-Level - [การวิเคราะห์ Cohort และ Retention](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/cohort-retention.md): 20 คำถาม, Mid-Level - [Google Tag Manager และการติดตาม](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/gtm-tracking.md): 20 คำถาม, Mid-Level - [API และ Webhook](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/apis-webhooks.md): 20 คำถาม, Mid-Level - [dbt - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/dbt-fundamentals.md): 20 คำถาม, Mid-Level - [AB Testing และสถิติประยุกต์](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/ab-testing.md): 20 คำถาม, Mid-Level - [Looker Studio (Google Data Studio)](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/looker-studio.md): 20 คำถาม, Mid-Level - [Power BI - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/power-bi-fundamentals.md): 20 คำถาม, Mid-Level - [SQL - การคิวรีเชิงวิเคราะห์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-advanced-analytics.md): 20 คำถาม, Senior - [dbt - ฟีเจอร์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/dbt-advanced.md): 20 คำถาม, Senior - [Power BI - DAX และแดชบอร์ดขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/power-bi-dax.md): 20 คำถาม, Senior - [Python Analytics - การวิเคราะห์ขั้นสูงและ ML](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/python-analytics-advanced.md): 20 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-joins