Complete the code to join two tables on the column 'id'.
SELECT * FROM table1 JOIN table2 ON table1.id [1] table2.id;The correct operator to join tables on matching 'id' values is '='.
Complete the code to perform a LEFT JOIN that includes all rows from table1.
SELECT * FROM table1 [1] JOIN table2 ON table1.id = table2.id;A LEFT JOIN returns all rows from the left table (table1) and matched rows from the right table.
Fix the error in the JOIN condition to correctly handle NULL values in 'id'.
SELECT * FROM table1 JOIN table2 ON table1.id = table2.id OR (table1.id IS NULL [1] table2.id IS NULL);To treat NULLs as equal in the join, use AND to check both are NULL.
Fill both blanks to join tables treating NULLs as equal in 'key' columns.
SELECT * FROM t1 JOIN t2 ON (t1.key [1] t2.key) OR (t1.key IS NULL [2] t2.key IS NULL);
Use '=' to compare keys and 'AND' to check both keys are NULL together.
Fill all three blanks to select rows where 'col1' matches or both are NULL, and 'col2' matches.
SELECT * FROM A JOIN B ON (A.col1 [1] B.col1 OR (A.col1 IS NULL [2] B.col1 IS NULL)) AND A.col2 [3] B.col2;
Use '=' to compare columns, 'AND' to ensure both col1 are NULL together, and '=' for col2 match.