Customer records include a nullable discount-rate column.
Treat NULL as a business default for one calculation, but as unknown and excluded for another.
Which SQL approach is most appropriate?
Use COALESCE, filters, and aggregate semantics explicitly according to the business rule for each column.
Detailed explanation
IAM controls access and does not evaluate SQL column values.
IAM controls access and does not evaluate SQL column values.
Object generations do not represent a missing value in a SQL column.
Object generations do not represent a missing value in a SQL column.
The query can distinguish a default value from an unknown value instead of changing every NULL identically.
The query can distinguish a default value from an unknown value instead of changing every NULL identically.
An empty string is not NULL and can break numeric calculations or the meaning of missing data.
An empty string is not NULL and can break numeric calculations or the meaning of missing data.
Check official documentation
Compare the following points with the official documentation.
Athena・RedshiftのNULL、COALESCE、COUNT、SUMの公式説明を確認する。
What to confirm
NULL・空文字・0の意味の違いを説明できる。
Key points
- SQL NULL
- COALESCE
- Three-valued logic
- Aggregation
Notes
- Environment: AWS公式DEA-C01試験ガイドと各サービスの公式ドキュメントの確認
- Confirm current AWS service behavior in the official DEA-C01 documentation.
Foundation review
Meaning before conversion
Choose a default or exclusion based on business semantics rather than replacing every missing value.
Aggregate behavior
Check how COUNT, SUM, and filters treat NULL and whether a default changes the metric.