DA0-002 · Question #100
An analyst needs to produce a final dataset using the following tables: The expected output should be formatted as follows: | CourseID | SectionNumber | StudentID | FirstName | LastName | Which of the
The correct answer is B. Join. To combine information from separate tables (e.g., CourseSections and Students) based on common columns and produce a wider dataset with all requested fields, a JOIN operation is the most appropriate action.
Question
An analyst needs to produce a final dataset using the following tables:
The expected output should be formatted as follows:
| CourseID | SectionNumber | StudentID | FirstName | LastName | Which of the following actions is the best way to produce the requested output?
Options
- AAggregate
- BJoin
- CGroup
- DFilter
How the community answered
(29 responses)- A14% (4)
- B76% (22)
- C3% (1)
- D7% (2)
Why each option
To combine information from separate tables (e.g., CourseSections and Students) based on common columns and produce a wider dataset with all requested fields, a JOIN operation is the most appropriate action.
Aggregate functions (like SUM, AVG, COUNT) are used to perform calculations on sets of rows, not to combine columns from different tables into a single wider dataset.
The expected output combines `CourseID` and `SectionNumber` from one table with `StudentID`, `FirstName`, and `LastName` from another table, indicating a need to link these tables together. A JOIN operation links rows from two or more tables based on a related column between them (like `StudentID`), allowing you to combine fields into a single result set.
Grouping is used with aggregate functions to perform calculations on subsets of rows that have the same values in specified columns, not to combine data across different tables in this manner.
Filtering (using a WHERE clause) restricts the number of rows returned from a table but does not combine columns from separate tables.
Concept tested: SQL JOIN for combining tables
Source: https://learn.microsoft.com/en-us/sql/relational-databases/performance/joins?view=sql-server-ver16
Topics
Community Discussion
No community discussion yet for this question.