Given a table of search queries and a table of bookings, write a query to identify the conversion rate of searches to confirmed appointments by specialty for Zocdoc.
Use all search queries in the provided data. A search is converted when it has at least one confirmed booking. Return percentages rounded to two decimal places.
specialty, search_count, confirmed_search_count, and conversion_rate_pct.| Column | Type | Description |
|---|---|---|
| search_query_idPK | INT | Unique identifier for a Zocdoc search query |
| specialty | VARCHAR(100) | Medical specialty selected for the search |
| searched_at | TIMESTAMP | Timestamp when the search occurred |
| Column | Type | Description |
|---|---|---|
| booking_idPK | INT | Unique identifier for a booking |
| search_query_id | INT | Search that led to the booking, when available |
| booking_status | VARCHAR(30) | Booking status, such as confirmed, pending, or cancelled |
| booked_at | TIMESTAMP | Timestamp when the booking was created |