Name and alias:
F is the alias of foods and T is the alias of foods_types. Aliases make table and self-join possible.
Here, we want to find out which season has mentioned the food with Season 4 in. (For details, see SQLite authoritative guide (Chinese version 2) page 85 );
Subquery:
In fact, in foods, the real form should be like this:
Remember to rename the subquery in the from clause. As a link source, the subquery in the from clause is often called an inline view or a derived table:
Subqueries are widely used. When using subqueries, you must constantly use them in different locations to see the results.
Compound query:
Composite query processes query results using three special Relational operators: Union, cross join, and difference set. The keywords are union, intersect, and except T. During the query, the number of related fields must be consistent. Only one order by statement can be used, which is at the end of a composite query. The composite query relationship is processed from left to right.