nerdexam
CompTIA

DA0-001 · Question #253

A data analyst has been asked to manipulate the data in the table below by first applying a DISTINCT function, and then applying a SUM function, to get the total product cost for a customer: Which…

The correct answer is B. $6,297. To calculate the final product cost by first applying a DISTINCT function and then a SUM function, one must identify unique product costs from the dataset and then add them together. For the implied dataset, the sum of unique product costs results in $6,297.

Data Analysis

Question

A data analyst has been asked to manipulate the data in the table below by first applying a DISTINCT function, and then applying a SUM function, to get the total product cost for a customer:

Which of the following is the final cost of the product?

Exhibit

DA0-001 question #253 exhibit

Options

  • A$5,402
  • B$6,297
  • C$7,634
  • D$8,642

How the community answered

(66 responses)
  • A
    2% (1)
  • B
    83% (55)
  • C
    5% (3)
  • D
    11% (7)

Why each option

To calculate the final product cost by first applying a DISTINCT function and then a SUM function, one must identify unique product costs from the dataset and then add them together. For the implied dataset, the sum of unique product costs results in $6,297.

A$5,402

A sum of $5,402 would result from a different set of distinct values or an incorrect calculation.

B$6,297Correct

Applying a DISTINCT function first would identify all unique product cost values from the original table. Subsequently, the SUM function would add only these unique values together, avoiding double-counting any repeated product costs to arrive at the total, which for the implied data is $6,297.

C$7,634

A sum of $7,634 would result from a different set of distinct values or an incorrect calculation.

D$8,642

A sum of $8,642 would result from a different set of distinct values or an incorrect calculation.

Concept tested: SQL functions - DISTINCT and SUM

Source: https://learn.microsoft.com/en-us/sql/t-sql/functions/sum-transact-sql?view=sql-server-ver16

Topics

#Data Manipulation#SQL Functions#DISTINCT#SUM

Community Discussion

No community discussion yet for this question.

Full DA0-001 Practice