What's the difference between LEFT SEMI JOIN, LEFT ANTI JOIN, and LEFT ANY JOIN in ClickHouse?

A service uses PostgreSQL 16, MySQL 8.4, and ClickHouse 24.10. The customers table stores customer records, and orders stores their orders. Each customer may have multiple orders. You need three reports: (1) customers with at least one order; (2) customers with no orders at all; and (3) all customers, with details from at most one order per customer, including those who have never made a purchase. Compare LEFT SEMI JOIN, LEFT ANTI JOIN, and LEFT ANY JOIN in ClickHouse. Which customers does each join return, and how many rows will each produce? Then explain how you'd write the equivalent queries using EXISTS/NOT EXISTS in PostgreSQL and MySQL, accounting for the capabilities of the specified versions.

ExplainJOIN and row countsMiddleAnalystData EngineerBackendQA