Hi Trishla,
Firstly, I would highly recommend taking a look at the OQL documentation available here: OQL | Mendix Documentation
OQL is in somewhat similar to SQL. Therefore, having some knowledge of SQL will be very helpful.
The SELECT clause determines what is returned. It is generally in the form [Table].[Column] [Alias]. It may also be a function such as COUNT([Table].[Column]) [Alias]. For the available functions, see the docs.
In your case, the following:
The FROM and JOIN clauses determine the data you extracted. There are some comprehensive material available on SQL JOINS, so please look into that.
In your case, the following:
The WHERE clause helps to filter the values extracted from the FROM and JOIN clauses.
In your case, the following:
The GROUP BY clause help group data based on a column (or columns!) and is required for certain functions, such as COUNT().
In your case, the following:
This results in a list, containing the unique Name values from the Department table and the count (number) of Shift associated with the Department Name where the Shift does not have a Employee associated with it.