Table A has ids (1,1,1,NULL,2,2,NULL,3,3,7,9) and Table B has ids (1,1,2,2,2,3,3,6,8). Give the output of: SELECT a.id with INNER JOIN on a.id=b.id; with LEFT JOIN; with RIGHT JOIN; and SELECT a.id, b.id with RIGHT JOIN.
Asked in the Round 1 live SQL stage. The interviewer pushed, "Are you sure this is correct?" on the RIGHT JOIN NULL handling.
a_id ascending with NULLs first, then b_id ascending with NULLs first.result_set, a_id, b_id.INNER JOIN, a.id, LEFT JOIN, a.id, RIGHT JOIN, a.id, and RIGHT JOIN, a.id and b.id.result_set ascending before applying the specified a_id and b_id ordering.NULL ids as nonmatching for equality comparisons.| Column | Type | Description |
|---|---|---|
| id | INT | Identifier value, including duplicate and NULL values |
| Column | Type | Description |
|---|---|---|
| id | INT | Identifier value, including duplicate and unmatched values |