
This is a regular “data quiz”. Follow it on LinkedIn. Test your knowledge or learn something new.
Today Question:
Which type of JOIN returns all rows from the left table and matching ones from the right?
A) INNER
B) LEFT
C) RIGHT
D) FULL
Correct Answer: B
Explanation
LEFT JOIN is one of the most important types of joins in SQL, used to combine data from two tables. With LEFT JOIN, all records from the left table (the first table in the query) are preserved regardless of whether a corresponding record exists in the right table. If a match is found, a complete record from both tables is returned. If no match is found, columns from the right table will have NULL values. This type of join is very useful in data analysis when we want to preserve all records from the main table and add supplementary information from another table. LEFT JOIN is often used when creating reports where we need to display all customers with their orders, or all employees with their projects. Performance-wise, LEFT JOIN is relatively efficient, but with large tables it’s important to have properly configured indexes on join keys.
Subscribe to Our Newsletter
