Which three statements are true regarding sub queries? (Choose three.)
A.
Multiple columns or expressions can be compared between the main query and sub query
B.
Sub queries can contain GROUP BY and ORDER BY clauses
C.
Only one column or expression can be compared between the main query and subqeury
D.
Main query and sub query can get data from different tables
E.
Main query and sub query must get data from the same tables
F.
Sub queries can contain ORDER BY but not the GROUP BY clause
Sub queries can contain GROUP BY and ORDER BY clauses.
Edit: Sub queries can’t contain GROUP BY and ORDER BY clauses.
Subqueries can always contain a GROUP BY clause.
An ORDER BY clause is bit more tricky and only seems to work if the subquery is in the FROM clause of the outer query.
select * from (select a, b from dummy_table where a > 1 order by b);
A.
Multiple columns or expressions can be compared between the main query and sub query =because some subquery are multi row, multi columns subquery
B.
Sub queries can contain GROUP BY and ORDER BY clauses= Yes
A.
Multiple columns or expressions can be compared between the main query and sub query
B.
Sub queries can contain GROUP BY and ORDER BY clauses
C.
Only one column or expression can be compared between the main query and subqeury
D.
Main query and sub query can get data from different tables