Exam Certified Data Engineer Associate All QuestionsBrowse all questions from this exam
Question 68

A data engineer is working with two tables. Each of these tables is displayed below in its entirety.

The data engineer runs the following query to join these tables together:

Which of the following will be returned by the above query?

    Correct Answer: C

    The query uses a LEFT JOIN, which returns all records from the left table (sales) and the matching records from the right table (favorite_stores). If there are no matches, NULL is returned for columns from the right table. In this case, customer_id 'a3' in the sales table does not have a corresponding entry in the favorite_stores table, so its store_id will be NULL. The resulting joined table will include all records from the sales table, with matching store_id from the favorite_stores table where available. Therefore, the correct result will display customer_ids 'a1', 'a3', and 'a4', with 'a3' having store_id as NULL.

Discussion
kz_dataOption: C

C is correct

nedloOption: C

C is correct answer

55f31c8Option: C

The LEFT JOIN keyword returns all records from the left table (table1), and the matching records from the right table (table2). The result is 0 records from the right side, if there is no match.

[Removed]Option: C

The LEFT JOIN keyword returns all records from the left table, even if there are no matches in the right table.

potaryxkugOption: C

C is correct

Blacknight99Option: C

C is the correct answer

HuroyeOption: C

The answer is C. this is a Left Join. In this case you show everything on the left side regardless of whether they appear on the right. When it does not appear on the right you represent that with a Null. So, for a3, store id is null.

anandpsg101Option: C

c is corret

dev_soumya369Option: C

C is the correct answer. In a LEFT JOIN, all the records from the left table are included, and only the matching records from the right table are added. In this case, "a1" and "a4" from the left table (favorite_stores) match with "a1" and "a4" from the right table (sales). So, these matching records are fetched. Additionally, all the records from the left table, including "a3," are included. Since "a3" has no corresponding store_id in the right table, the store_id for "a3" will be NULL. Therefore, after the LEFT JOIN, the result will include "a1," "a3" (with a NULL store_id), and "a4."

mokraniOption: C

C is correct. please refer to this simple blog if any confusion regarding JOINS https://sql.sh/cours/jointures

meow_akkOption: C

Ans C: Left join only keeps left recs and only the matching recs from Right table. in other words : the left table is preserved as is.

kishanuOption: C

A typical LEFT JOIN scenario