nerdexam
CompTIA

DA0-001 · Question #76

A data analyst has been asked to merge the tables below, first performing an INNER JOIN and then a LEFT JOIN: Customer Table In-store Transactions Which of the following describes the number of rows o

The correct answer is A. INNER: 6 rows; LEFT: 9 rows. INNER JOIN: An INNER JOIN returns only the rows that match in both tables. The common column used for joining is "Customer ID". In this case, there are 6 customers with matching Customer IDs in both the Customer Table and In-store Transactions table, so the number of rows after p

Data Analysis

Question

A data analyst has been asked to merge the tables below, first performing an INNER JOIN and then a LEFT JOIN:

Customer Table In-store Transactions Which of the following describes the number of rows of data that can be expected after performing both joins in the order stated, considering the customer table as the main table?

Exhibit

DA0-001 question #76 exhibit

Options

  • AINNER: 6 rows; LEFT: 9 rows
  • BINNER: 9 rows; LEFT: 6 rows
  • CINNER: 9 rows; LEFT: 15 rows
  • DINNER: 15 rows; LEFT: 9 rows

How the community answered

(43 responses)
  • A
    84% (36)
  • B
    5% (2)
  • C
    9% (4)
  • D
    2% (1)

Explanation

INNER JOIN: An INNER JOIN returns only the rows that match in both tables. The common column used for joining is "Customer ID". In this case, there are 6 customers with matching Customer IDs in both the Customer Table and In-store Transactions table, so the number of rows after performing an INNER JOIN would be 6. LEFT JOIN: A LEFT JOIN returns all the rows from the left table (Customer Table), and the matching rows from the right table (In-store Transactions). If there is no match, NULL values will be displayed in the right table columns. In this case, there are 9 customers in the Customer Table, but only 6 have matching Customer IDs in the In-store Transactions table, so there would be 9 rows after performing a LEFT JOIN.

Topics

#SQL Joins#Data Merging#Relational Databases#Data Querying

Community Discussion

No community discussion yet for this question.

Full DA0-001 Practice