Explain the result of joining two tables: Table1 has one column with 3 records: 1, 1, NULL. Table2 has one column with 2 records: 1, NULL. What will be the result of a LEFT JOIN and an INNER JOIN?
💡 Model Answer
For the INNER JOIN, only rows with matching non‑NULL values are returned. Table1 has two 1s and one NULL; Table2 has one 1 and one NULL. The join matches the two 1s from Table1 with the 1 from Table2, producing two rows: (1,1) and (1,1). The NULLs are not matched because NULL = NULL is unknown. For the LEFT JOIN, all rows from Table1 appear. The two 1s match the 1 in Table2, giving two rows (1,1) and (1,1). The NULL from Table1 has no match in Table2, so the right side is NULL, yielding (NULL,NULL). Thus LEFT JOIN returns three rows, INNER JOIN returns two rows.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500