Given a table of user search queries and a table of bookings, write a query to calculate the search-to-book conversion rate per day for Expedia Group. A booking counts as a conversion when it references a search through search_id; attribute it to the search date, regardless of the booking date. Exclude searches without a valid timestamp.
search_date, total_searches, converted_searches, and conversion_rate.search_date ascending. Return the rate as a decimal rounded to four places.| Column | Type | Description |
|---|---|---|
| search_idPK | INT | Unique identifier for a user search event |
| user_id | VARCHAR(50) | Identifier of the user who performed the search |
| searched_at | TIMESTAMP | Timestamp when the search occurred |
| query_text | VARCHAR(255) | Search text entered by the user |
| Column | Type | Description |
|---|---|---|
| booking_idPK | INT | Unique identifier for a booking |
| search_id | INT | Search event that led to the booking |
| booked_at | TIMESTAMP | Timestamp when the booking was created |
| booking_status | VARCHAR(20) | Current booking status |