ข้อใดใช้ alias และ INNER JOIN ได้ถูกต้องเพื่อแสดง a.id และ b.name

SELECT a.id, b.name FROM table_a CONNECT table_b ON a.id = b.id;
SELECT a.id, b.name FROM table_a MERGE table_b ON a.id = b.id;
SELECT a.id, b.name FROM table_a AS a INNER JOIN table_b AS b ON a.id = b.id;
SELECT a.id, b.name FROM table_a UNION table_b ON a.id = b.id;

เฉลยอธิบาย

ต้องประกาศ alias a และ b ให้ตารางก่อนอ้างคอลัมน์ และใช้ ON ระบุเงื่อนไขจับคู่ MERGE, CONNECT และ UNION ไม่ใช่รูปแบบ JOIN นี้

ข้อสอบอื่นในวิชาการใช้ภาษา SQL

ดูข้อสอบวิชานี้ทั้งหมด →