Describe the differences between TCP and UDP, including when you would use each and how you would choose between them when designing an application.
Using the provided application, protocol, and connection telemetry tables, write a SQL query that compares TCP and UDP for each application and recommends a protocol based on observed reliability and latency.
Output
- One row per application, including applications without telemetry.
- Return application name, TCP and UDP event counts, average latency, packet-loss rate, success rate, recommended protocol, and recommendation reason.
- Order by application ID ascending. Use
NULL for unavailable protocol metrics.