You're working as a data analyst at a tech company that runs user experiments across different platforms. Your task is to create a comprehensive report showing the distribution of experiments.
Given a table Experiments with the following structure:
| Column Name | Type |
|---|---|
| experiment_id | int |
| platform | enum ('Android', 'IOS', 'Web') |
| experiment_name | enum ('Reading', 'Sports', 'Programming') |
Your goal: Generate a complete matrix showing the count of experiments for every possible combination of platform and experiment type.
Important: The result must include all 9 possible combinations (3 platforms ร 3 experiments), even if some combinations have zero experiments. This ensures your report is complete and doesn't miss any gaps in testing coverage.
Return the results in any order, with columns: platform, experiment_name, num_experiments.
Input & Output
Visualization
Time & Space Complexity
Single table scan with efficient grouping and joining
Only constant extra space for the 9 combinations matrix
Constraints
- 1 โค experiment_id โค 106
- platform is one of ('Android', 'IOS', 'Web')
- experiment_name is one of ('Reading', 'Sports', 'Programming')
- 0 โค number of rows โค 104
- Result must include all 9 possible combinations