What are the trade-offs between normalized and denormalized data models in a cloud-based environment?
Using the provided normalized account, security, and holding data, write a query that produces an account-level holdings summary. Your solution should also make clear how the equivalent denormalized design would affect joins, consistency, and query simplicity.
Output
- One row per account, including accounts with no qualifying holdings.
- Columns:
account_id, total_market_value, and security_count.
- Include only active holdings, treat missing values as zero where appropriate, and order by
total_market_value descending, then account_id ascending.