Using a subquery
A subquery is a querying technique designed for more complex business questions that require us to analyze them further and additional information based on the data retrieved.
The subquery technique is used to return data that will be used by the main query. For example, we want to generate a better analysis for the sales team and understand which types of cars were bought by the same client.
The goal of this business question is to investigate whether a specific combination of car types are being bought by clients: did clients who bought Austin Martini cars buy other types of cars as well?
By analyzing this data, we will be able to make better marketing and sales offers to the customers as well as get some basic information about sales trends and customer behavior.
Getting ready
We want to analyze the client's car sales combinations; we will drag the Client Name, Maker, and Sales Revenue objects.
Here comes the catch. Creating a query filter based on the model object with the...