Company: Meesho (business analyst)
Difficulty: medium
Problem Description A portfolio management firm wants to analyze each client's investment preferences between long-term assets (bonds) and short-term assets (stocks). Write a query to calculate the total amount invested in each category side-by-side for each qualifying client. Schema Table: clients +-------------+--------------+-------------+--------------------+ | Column Name | Type | Constraint | Description | +-------------+--------------+-------------+--------------------+ | id | INT | PRIMARY KEY | Client ID | | name | VARCHAR(255) | | Name of the client | +-------------+--------------+-------------+--------------------+ Table: bonds_investments +-----------------+---------------+--------------------------------------+-----------------------------+ | Column Name | Type | Constraint | Description | +-----------------+---------------+--------------------------------------+-----------------------------+ | id | INT | PRIMARY KEY | Bond investment ID | | client_id | INT | FOREIGN KEY(c