nerdexam
CompTIA

DY0-001 · Question #29

A movie production company would like to find the actors appearing in its top movies using data from the tables below. The resulting data must show all movies in Table 1, enriched with actors listed…

The correct answer is D. Perform a LEFT JOIN on Table 1 using column Movie, with Table 2 using column Acted_In. A LEFT JOIN returns every row from Table 1 (all top movies) and brings in matching actors from Table 2 where the Movie = Acted_In, leaving NULLs for movies without listed actors.

Data Processing Technologies

Question

A movie production company would like to find the actors appearing in its top movies using data from the tables below. The resulting data must show all movies in Table 1, enriched with actors listed in Table 2. Which of the following query operations achieves the desired data set?

Exhibit

DY0-001 question #29 exhibit

Options

  • APerform an INNER JOIN between Table 1 using column Movie, and Table 2 using column
  • BPerform a UNION between Table 1 using column Movie, and Table 2 using column Acted_In.
  • CPerform an INTERSECT between Table 1 using column Movie, and Table 2 using column
  • DPerform a LEFT JOIN on Table 1 using column Movie, with Table 2 using column Acted_In.

How the community answered

(69 responses)
  • A
    1% (1)
  • B
    1% (1)
  • C
    3% (2)
  • D
    94% (65)

Explanation

A LEFT JOIN returns every row from Table 1 (all top movies) and brings in matching actors from Table 2 where the Movie = Acted_In, leaving NULLs for movies without listed actors.

Topics

#SQL joins#LEFT JOIN#data integration#relational databases

Community Discussion

No community discussion yet for this question.

Full DY0-001 Practice