Make a SQL query on multiple tables with Drupal 8
Drupal 8 provides an API, with EntityQuery, which significantly simplifies writing SQL queries to retrieve and list a set of contents. Thus it is very easy to retrieve a list of contents according to complex criteria and conditions, without needing to know precisely the tables and their syntax for each field associated with an entity. But we may need to resort to more complex queries that involve associating data from multiple tables.