**INNER JOIN**: Only rows with matches in both tables. **LEFT JOIN**: All from left; matches from right; NULLs where no match. **RIGHT JOIN**: All from right; matches from left. **FULL JOIN**: All from both; NULLs where no match. **Why it matters**: Join choice affects result...
Red Flag: Not knowing when result rows can explode (e.g., many-to-many without intent). Pro-Move: Say you always validate cardinality after joins—'I expect 1:1 here, so I check for duplicates.'
This medium-level SQL question appears frequently in data engineering interviews at companies like Accenture, Cognizant, EPAM, and 1 others. While less common, it tests deeper understanding that distinguishes strong candidates. Mastering the underlying concepts (join) will help you answer variations of this question confidently.
Break this problem into components. Identify the core trade-offs involved, then walk the interviewer through your reasoning step by step. Demonstrate awareness of edge cases and production considerations - this is what separates good answers from great ones.
INNER JOIN: Only rows with matches in both tables. LEFT JOIN: All from left; matches from right; NULLs where no match. RIGHT JOIN: All from right; matches from left. FULL JOIN: All from both; NULLs where no match. Why it matters: Join choice affects result cardinality and semantics. Wrong join = wrong numbers. Scalability: Hash joins are common; broadcast for small dimension. FULL OUTER can be expensive—large shuffle. Cost: INNER is cheapest (smaller result); FULL is costliest. Production note: LEFT JOIN to dimension tables often yields duplicates if dimension has 1-to-many; ensure key uniqueness.
This answer is partially locked
Unlock the full expert answer with code examples and trade-offs
Practice real interviews with AI feedback, track progress, and get interview-ready faster.
Pro starts at $19/mo - cancel anytime
Trusted by 10,000+ aspiring data engineers
According to DataEngPrep.tech, this is one of the most frequently asked SQL interview questions, reported at 4 companies. DataEngPrep.tech maintains a curated database of 1,863+ real data engineering interview questions across 7 categories, verified by industry professionals.