SELECT t FROM Team t WHERE t.league IS NULL
Data retrieved: All teams not associated with a league.
Description: The IS NULL expression can be used to check whether a relationship has been set between two entities. In this case, the query checks whether the teams are associated with any leagues and returns the teams that do not have a league.
See also: NULL Comparison Expressions and NULL Values.