14th: Using subqueries to define indeterminate data
1, sub-query and select in combination with
Select Colum from table where column, where columnb= (select Colum_name from ...);
2, sub-query and inset combined use
Insert table1 Select Column1 from table2 where cloumn2> (select ...);
Insert a few items in table two that meet the criteria into table 1, note: number of items inserted = number of Table1
3, sub-query and update use together
4, sub-query and delete in combination with
15th Chapter: Combining Multiple queries
1. Union
Select ID from Stu Union ID from Jobe; When the ID in the two table is the same, the output is not repeated.
2. UNION ALL
Select ID from STU UNION all ID from Jobe; When the ID in the two table is the same, the output repeats.
SQL Getting Started Classic (fifth edition) Ryan Stephens study notes Part IV: Building Complex database queries