Write a SQL query to calculate conversion rate by campaign and date, and rank campaigns by performance. Use the provided campaign and event data, treating clicks as the denominator and conversions as the numerator. Exclude events without a valid campaign or date.
campaign_name, event_date, click_count, conversion_count, conversion_rate, and performance_rank.| Column | Type | Description |
|---|---|---|
| campaign_idPK | INT | Unique campaign identifier |
| campaign_name | VARCHAR(100) | Campaign name |
| campaign_channel | VARCHAR(50) | Marketing channel for the campaign |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| campaign_id | INT | Campaign associated with the event |
| event_date | DATE | Date on which the event occurred |
| event_type | VARCHAR(20) | Event classification, such as click or conversion |
| user_id | VARCHAR(50) | Anonymous user identifier |