DA0-002 · Question #22
A data professional wants to identify all customers who made a purchase in January. Given the following table: Which of the following types of functions should the professional use to flag the…
The correct answer is B. Logical. To identify customers who made a purchase in January, a data professional should use logical functions. While date functions can extract the month, logical functions are essential for comparing that extracted month to a specific value like 'January'.
Question
A data professional wants to identify all customers who made a purchase in January. Given the following table:
Which of the following types of functions should the professional use to flag the customers?
Options
- AStatistical
- BLogical
- CMathematical
- DDate
How the community answered
(16 responses)- B94% (15)
- D6% (1)
Why each option
To identify customers who made a purchase in January, a data professional should use logical functions. While date functions can extract the month, logical functions are essential for comparing that extracted month to a specific value like 'January'.
Statistical functions are used for calculations like averages, sums, counts, or standard deviations, not for directly identifying records based on a specific month.
Logical functions (e.g., IF, AND, OR, WHERE clauses with comparison operators) are used to evaluate conditions and return a boolean result or filter data based on criteria. To flag customers who purchased in January, one would typically use a logical condition like MONTH(PurchaseDate) = 1.
Mathematical functions perform arithmetic operations (e.g., addition, subtraction, multiplication), which are not directly used to identify records based on a month condition.
Date functions are used to extract parts of a date (like MONTH(), YEAR()) or perform date calculations, but a logical function is still required to compare the extracted month to 'January'.
Concept tested: Data filtering with logical functions
Source: https://docs.microsoft.com/en-us/sql/t-sql/language-elements/logical-operators-transact-sql
Topics
Community Discussion
No community discussion yet for this question.