Analyst Integration Question:

What is the difference between an inner join and a left join in SQL?

Tweet Share WhatsApp

Answer:

In SQL, there are mainly two types of joins, inner join and outer join. Again outer joins can be two types right and left outer join. Main difference between inner join and left join is that in case of former only matching records from both tables are selected while in case of left join, all records from left table is selected in addition to matching records from both tables. Always watch out for queries which has "all" in it, they usually require left join e.g. write sql query to find all departments and number of employees on it. If you use inner join to solve this query, you will missed empty departments where no one works.

Download Integration Programmer PDF Read All 87 Integration Programmer Questions
Previous QuestionNext Question
What is difference between a binary tree and a binary search tree?What is time complexity of an algorithm?