データ エンジニアは、顧客がバニラ アイスクリームを好むかどうかを把握するためのデータベース フィールドを作成しています。この情報を取得するのに最適なデータ タイプは次のどれですか。
正解:B
When designing a database field to capture a binary preference, such as whether a customer likes vanilla ice cream, the most appropriate data type is:
Option B:Boolean
* Rationale:A Boolean data type is used to represent binary values, typically TRUE or FALSE. In this context, it efficiently captures whether a customer likes (TRUE) or does not like (FALSE) vanilla ice cream.
Option A:Integer
* Rationale:While integers represent whole numbers, using them to denote binary choices (e.g., 1 for
"likes" and 0 for "dislikes") is less intuitive and can lead to ambiguity without proper context.
Option C:Categorical
* Rationale:Categorical data types are used for fields that can take on one of a limited set of values, representing different categories. While "likes" and "dislikes" could be categories, a Boolean is more efficient for binary choices.
Option D:Numeric
* Rationale:Numeric data types encompass both integers and floating-point numbers. Using a numeric type for a binary preference is unnecessary and could lead to data integrity issues.
Reference:The CompTIA Data+ Certification Exam Objectives discuss various data types and their appropriate use cases, emphasizing the selection of suitable data types for specific data capture needs.
partners.comptia.org